byu-dnasc / proto-smrtlink-share

0 stars 1 forks source link

Define how to authenticate for access to Globus services #19

Open adknaupp opened 3 months ago

adknaupp commented 3 months ago

Client Credentials Authentication

The DNASC app needs authorization tokens to access Globus APIs. These tokens are obtained from Globus Auth using Client Credentials Authentication. Client Credentials Authentication is defined by an OAuth2 protocol and implemented by the Globus SDK. This type of authentication involves an application to register itself with Globus Auth using its own set of credentials, i.e. a client ID and a client secret. The Globus SDK documentation shows how to use client credentials to authenticate a python app.

Preparation

The app needs to have a Globus identity in order use Client Credentials Authentication. This identity can be created by registering an app with Globus using the following steps:

Application credentials have been created for the DNASC app:

Globus SDK Usage

The Globus SDK implements all necessary authorization functionality. Rather than having to juggle tokens and refresh them manually, the SDK provides special classes for authorizing a "confidential client" with Globus Auth:

Class Name Inputs
ConfidentialAppAuthClient Client ID, Client Secret
ClientCredentialsAuthorizer ConfidentialAppAuthClient, Scopes

An instance of ClientCredentialsAuthorizer can be used by other Globus clients to authenticate any API call for which the client has been granted access (based on the scope(s) requested at the time the auth client was authorized). It also automatically refreshes tokens when they expire.

Scopes

Create access rule: urn:globus:auth:scope:transfer.api.globus.org:all