Show / Hide Table of Contents

ParseUri Method

ParseUri(Uri)

Parses an 'otpauth://' Uri that received from QR reader or manually from server.

C#
public static Credential ParseUri(Uri uri)

Parameters

Type Name Description
Uri uri

Returns

Credential

The credential with parameters.

Exceptions

Type Condition
ArgumentNullException

The Uri is null.

InvalidOperationException

The Uri path or schema is invalid, or the credential's algorithm or period is invalid.

Remarks

When you enable two-factor authentication on websites, they usually show you a QR code and ask you to scan and launch an authenticator app. QR codes are used in scanning secrets to generate one-time passwords. Secrets may be encoded in QR codes as a URI as specified by https://github.com/google/google-authenticator/wiki/Key-Uri-Format

In this article
Back to top Generated by DocFX