Authentication And Authorization

Authentication and Authorization

The Node.js SDK invokes the Verizon Personal Cloud Storage APIs to begin the authentication and authorization flow. When you start integrating the Node.js 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.

Code Sample

	var authUrl = cloud.getAuthorizeUrl();
	//redirects user to authUrl

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

  • Authentication and Authorization API Calls:

    • init - initializes the API with the Key, Secret, and callback URL that you specified in Key Management when you registered your app.
    • getAuthorizeUrl - returns an authorization URL.
    • 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.