Authentication And Authorization

Authentication and Authorization

Contents

Introduction

To integrate Verizon Personal Cloud Storage SDK for Android with your app, 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.

Refer to API Developer Guide for detailed information on the API authentication and authorization process.

NOTE: The Callback URL is case sensitive.

Authentication and Authorization API Calls

  • authorize - authenticates the user and authorizes the application to access user’s cloud content through Verizon Personal Cloud Storage APIs.
  • hasAuthorization - verifies if the user is authorized.
  • logout - logs the user out from the current session.

Authenticating Your Application

The following code snippet allows you to begin the authorization. Use the Android Activity to initialize CloudAPI object and check for authorization in onResume method. Calling authorize(this) begins the OAuth 2.0 authorization process.

Code Sample

cloudAPI.authorize(this, new AuthorizationCallback() {
		@Override
        public void onError(CloudAPIException exception) {
        	/*
        	 * onError is called if there is an error processing the request
        	 * or user denies the consent to the application to access the cloud.
        	 */
        }

        @Override
        public void onSuccess() {
        	/*
        	 * onSuccess is called when user is authenticated and 
        	 * application is authorized to access user's content from the cloud.
        	 */
        }
});

Calling authorize(this) begins the OAuth 2.0 authorization process described in detail on the Authentication and Authorization page. The calling activity is then brought to the foreground and onResume method is called.

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