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 |
---|---|---|
System.Uri | uri |
Returns
The credential with parameters.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The Uri is null. |
System.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