# GraffitiTOTPProvider
Class Inherits GraffitiSuite.BaseObject
## About
GraffitiTOTPProvider is a class that supports the creation and validation of time-based one time passcodes.
## Preview

Previous
Next
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Attributes | Hidden | Function | |
| Sub | Constructor | (None) | Creates a new instance. Note that the Secret property should be populated at some point in order for the class to function as expected. |
| Sub | Constructor | (None) | Creates a new instance. Note that the Secret property should be populated at some point in order for the class to function as expected. |
| Function | Generate | As | Generates a new code for the time specified. If not time is specified then DateTime.now is used. |
| Function | GenerateBackupCodes | As | Generates a set of backup codes. These should be stored somewhere with user data so that they can be compared if validation fails when the user enters a failing code. |
| Function | ToQRCode | As | Uses Xojo's built-in Barcode.Image functionality to generate a QR code that the user can scan to add the TOTP credentials to their authenticator app. This does not currently function on Xojo Web as Barcode.Image is not supported, but will require no future changes once it is. |
| Function | ToURI | As | Returns the OTPAUTH:// URI for the secret plus the parameters. May be used with GraffitiQR to display QR codes for authenticator scanning. |
| Function | Verify | As | Checks the code to see if it matches with the one generated for the current timeframe, last timeframe, or the next timeframe. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| Secret | String | Nil | Secret string used for generation and validation. This should be unique to each user, and will need to be stored to use for verification later. |