skipper: Index | Files

package oauth

import ""

Package oauth implements an authentication client to be used with OAuth2 authentication services.

The package uses two json documents to retrieve the credentials, with the file names: client.json and user.json. These documents must be found on the file system under the directory passed in with the credentialsDir argument.

The structure of the client credentials document:

{"client_id": "testclientid", "client_secret": "testsecret"}

The structure of the user credentials document:

{"application_username": "testusername", "application_password": "testpassword"}

The GetToken method ignores the expiration date and makes a new request to the OAuth2 service on every call, so storing the token, if necessary, is the responsibility of the calling code.


Package Files


type OAuthClient Uses

type OAuthClient struct {
    // contains filtered or unexported fields

An OAuthClient implements authentication to an OAuth2 service.

func New Uses

func New(credentialsDir, oauthUrl, permissionScopes string) *OAuthClient

Initializes a new OAuthClient.

func (*OAuthClient) GetToken Uses

func (oc *OAuthClient) GetToken() (string, error)

Returns a new authentication token.

Package oauth imports 6 packages (graph) and is imported by 6 packages. Updated 2017-04-24. Refresh now. Tools for package owners.