edgio-go-sdk

internal/token

The main goal of this package is to hold any logic related to the aquisition/refreshing/invalidation generated by Edgio REST API client.

token.GetAccessToken(credentials common.Creds) (string, error)

This func outsources the process of getting an auth token from Edgio’s Auth service. It assumes Edgio’s standard auth endpoint as a default URL, but that can be overwritten by your own, in the event of an enterprise/self-hosted app.

It will double check of the credentials are present, and return an error if they are not, and then perform the HTTP request needed to get an access token to be used on the other edgio endpoints.

credentials = common.Creds{
  Key: "some-clinet-key",
  Secret: "some-clinet-secret",
  Scopes: "some-scopes",
  AuthURL: "optional-auth-url",
}

token.GetAccessToken(credentials) // returns the access token in plain text

token.GetAccessToken Mandatory Params

token.GetAccessToken Optional Params & Default Values

back to the main README