SmartVault allows you to get details about registered users; more specifically they let you retrieve their status regarding authorization and activation.
Remember you'll need to use the client token for every getting the account information. Also, the info you add while the user is logged in will be wiped out once the user signs out of the account.
The basic access authorization header value for this request needs to be:
The authorization property is related to the ability of your client to perform operations as the user being retrieved.
If the user is activated but not authorized, the "authorization_uri" parameter will contain the URL that the user needs to visit in order to authorize your application. This "authorization_uri" will show on the body of the response only if not authorized:
After clicking on the link, the user will be prompted to allow the request:
Once you've clicked "Allow", the client id is now listed under "My Apps" and if you execute the request again, the "authorized" param will be set to "true".
You can optionally add a "redirect_uri" parameter to this "authorization_uri" in order to return the user to where they were in your workflow.
Example of an authorization URL, with redirect_uri added to the end:
Ensure that you encode your URL properly if you use this feature.
If any error happens while using the redirection, three additional parameters will be added to the URL when the user is redirected back to your application:
error_reasonAn integer based error value.
errorA textual representation of the error.
error_descriptionA more detailed description of the error.
Activation is a technique SmartVault uses to verify the end user has possession of the email account used for login purposes.
The "activated" property of the response indicates whether or not the user has been activated in SmartVault. A user that has not been activated cannot log into SmartVault directly or indirectly (via your client). You'll need to led the user to activate their account before being able to make the integration works. You can check more information about this on the [Authorized section](#authorized) above.
let task =URLSession.shared.dataTask(with: request){ data, response, error in
iflet response = response {
print(response)
iflet data = data,let body =String(data: data, encoding:.utf8){
print(body)
}
}else{
print(error ??"Unknown error")
}
}
task.resume()
Response
Returns whether or not the account its activated and / or authorized as well as the account id. You can get more information about what authorized and activated means at the beggining of this page.
Show success object
Returns an error object if the email doesn't exist.