Authentication and Authorization

Authentication And Authorization

The JavaScript SDK invokes the Verizon Personal Cloud Storage APIs to begin the authentication and authorization flow. When you start integrating the Javascript SDK with your app, you will need to provide the Key and Secret generated for your app by Key Management, as well as the Callback URL that you entered when you have registered your app.

The following code snippet allows you to begin the authorization process. The JavaScript SDK will automatically exchange the OAuth 2.0 authorization code for access and refresh tokens once the Callback URL is called.

Code Sample;

After the authorization is successfully completed, the postAuthenticated callback will be called, and you may begin making authenticated calls. You may also call to check if a user has completed the OAuth 2.0 authorization flow.

  • Authentication and Authorization API Calls:
    • authorize - authenticates the user and authorizes the application to access user's content through Verizon Personal Cloud Storage APIs.
    • getAuthorizeUrl - returns an authorization URL.
    • init - initializes the API with the Key, Secret, and callback URL that you specified in Key Management when you registered your app.
    • isAuthenticated - returns true when the user has completed OAuth 2.0 authentication process. Once this value is set, you may begin making API calls.
    • isInitted - helper method that a client can use to check if the SDK has been successfully initialized.
    • ready - ready handler you can use to execute code after init.
    • token - exchanges an authorization code obtained from a successful authorize call for access and refresh tokens.

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.