IBM Cloud SDK Core  1.3.0
The IBM.Cloud.SDK.Core is a core project of SDKs generated using the IBM OpenAPI SDK generator.
IBM.Cloud.SDK.Core.Authentication.Bearer.BearerTokenAuthenticator Class Reference

This class implements support for Bearer Token Authentication. The main purpose of this authenticator is to construct the Authorization header and then add it to each outgoing REST API request. More...

Inheritance diagram for IBM.Cloud.SDK.Core.Authentication.Bearer.BearerTokenAuthenticator:
IBM.Cloud.SDK.Core.Authentication.Authenticator IBM.Cloud.SDK.Core.Authentication.IAuthenticator

Public Member Functions

 BearerTokenAuthenticator (string bearerToken)
 Construct a BearerTokenAuthenticator instance with the specified access token. The token value will be used to construct an Authorization header that will be included in outgoing REST API requests. More...
 
 BearerTokenAuthenticator (Dictionary< string, string > config)
 Construct a BearerTokenAuthenticator using properties retrieved from the specified Map. More...
 
override void Authenticate (IClient client)
 This method is called to authenticate an outgoing REST API request. Here, we'll just set the Authorization header to provide the necessary authentication info. More...
 
override void Validate ()
 Validates the current set of configuration information in the Authenticator. More...
 

Properties

string BearerToken [get, set]
 The access token configured for this authenticator More...
 
override string AuthenticationType [get]
 
- Properties inherited from IBM.Cloud.SDK.Core.Authentication.Authenticator
virtual string AuthenticationType [get]
 Returns the authentication type associated with the Authenticator instance. More...
 
- Properties inherited from IBM.Cloud.SDK.Core.Authentication.IAuthenticator
string AuthenticationType [get]
 Returns the authentication type associated with the AuthenticatorConfig instance. More...
 

Additional Inherited Members

- Public Attributes inherited from IBM.Cloud.SDK.Core.Authentication.Authenticator
const string AuthTypeBasic = "basic"
 These are the valid authentication types. More...
 
const string AuthTypeNoAuth = "noAuth"
 
const string AuthTypeIam = "iam"
 
const string AuthTypeCp4d = "cp4d"
 
const string AuthTypeBearer = "bearerToken"
 
- Static Public Attributes inherited from IBM.Cloud.SDK.Core.Authentication.Authenticator
static string PropNameAuthType = "AUTH_TYPE"
 Constants which define the names of external config propreties (credential file, environment variable, etc.). More...
 
static string PropNameUsername = "USERNAME"
 
static string PropNamePassword = "PASSWORD"
 
static string PropNameBearerToken = "BEARER_TOKEN"
 
static string PropNameUrl = "AUTH_URL"
 
static string PropNameDisableSslVerification = "AUTH_DISABLE_SSL"
 
static string PropNameApikey = "APIKEY"
 
static string PropNameClientId = "CLIENT_ID"
 
static string PropNameClientSecret = "CLIENT_SECRET"
 
static string ErrorMessagePropMissing = "The {0} property is required but was not specified."
 
static string ErrorMessagePropInvalid = "The {0} property is invalid. Please remove any surrounding {{, }}, or \" characters."
 
static string ErrorMessageReqFailed = "Error while fetching access token from token service: "
 

Detailed Description

This class implements support for Bearer Token Authentication. The main purpose of this authenticator is to construct the Authorization header and then add it to each outgoing REST API request.

Constructor & Destructor Documentation

◆ BearerTokenAuthenticator() [1/2]

IBM.Cloud.SDK.Core.Authentication.Bearer.BearerTokenAuthenticator.BearerTokenAuthenticator ( string  bearerToken)
inline

Construct a BearerTokenAuthenticator instance with the specified access token. The token value will be used to construct an Authorization header that will be included in outgoing REST API requests.

Parameters
bearerTokenThe access token value

◆ BearerTokenAuthenticator() [2/2]

IBM.Cloud.SDK.Core.Authentication.Bearer.BearerTokenAuthenticator.BearerTokenAuthenticator ( Dictionary< string, string >  config)
inline

Construct a BearerTokenAuthenticator using properties retrieved from the specified Map.

Parameters
configConfig a map containing the access token value

Member Function Documentation

◆ Authenticate()

override void IBM.Cloud.SDK.Core.Authentication.Bearer.BearerTokenAuthenticator.Authenticate ( IClient  client)
inlinevirtual

This method is called to authenticate an outgoing REST API request. Here, we'll just set the Authorization header to provide the necessary authentication info.

Parameters
client

Reimplemented from IBM.Cloud.SDK.Core.Authentication.Authenticator.

◆ Validate()

override void IBM.Cloud.SDK.Core.Authentication.Bearer.BearerTokenAuthenticator.Validate ( )
inlinevirtual

Validates the current set of configuration information in the Authenticator.

Reimplemented from IBM.Cloud.SDK.Core.Authentication.Authenticator.

Property Documentation

◆ AuthenticationType

override string IBM.Cloud.SDK.Core.Authentication.Bearer.BearerTokenAuthenticator.AuthenticationType
get

◆ BearerToken

string IBM.Cloud.SDK.Core.Authentication.Bearer.BearerTokenAuthenticator.BearerToken
getset

The access token configured for this authenticator


The documentation for this class was generated from the following file: