IBM Cloud SDK Core  1.1.0
The IBM.Cloud.SDK.Core is a core project of SDKs generated using the IBM OpenAPI SDK generator.
IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator Class Reference

This class implements support for the CP4D authentication mechanism. More...

Inheritance diagram for IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator:
IBM.Cloud.SDK.Core.Authentication.Authenticator IBM.Cloud.SDK.Core.Authentication.IAuthenticator

Public Member Functions

 CloudPakForDataAuthenticator (string url, string username, string password, bool? disableSslVerification=null, Dictionary< string, string > headers=null)
 Constructs a CloudPakForDataAuthenticator with all properties. More...
 
 CloudPakForDataAuthenticator (Dictionary< string, string > config)
 Construct a CloudPakForDataAuthenticator instance using properties retrieved from the specified Map. More...
 
override void Authenticate (IClient client)
 Perform the necessary authentication steps for the specified request. More...
 
override void Validate ()
 Validates the current set of configuration information in the Authenticator. More...
 

Protected Member Functions

string GetToken ()
 This function returns an access token. The source of the token is determined by the following logic: More...
 
DetailedResponse< CloudPakForDataTokenResponseRequestToken ()
 

Properties

IClient Client [get, set]
 
string Url [get]
 
string Username [get]
 
string Password [get]
 
bool DisableSslVerification [get, set]
 
Dictionary< string, string > Headers [get, set]
 
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 the CP4D authentication mechanism.

Constructor & Destructor Documentation

◆ CloudPakForDataAuthenticator() [1/2]

IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.CloudPakForDataAuthenticator ( string  url,
string  username,
string  password,
bool?  disableSslVerification = null,
Dictionary< string, string >  headers = null 
)
inline

Constructs a CloudPakForDataAuthenticator with all properties.

Parameters
urlThe base URL associated with the token server. The path "/v1/preauth/validateAuth" will be appended to this value automatically.
usernameThe username to be used when retrieving the access token
passwordThe password to be used when retrieving the access token
disableSslVerificationA flag indicating whether SSL hostname verification should be disabled
headersA set of user-supplied headers to be included in token server interactions

◆ CloudPakForDataAuthenticator() [2/2]

IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.CloudPakForDataAuthenticator ( Dictionary< string, string >  config)
inline

Construct a CloudPakForDataAuthenticator instance using properties retrieved from the specified Map.

Parameters
configA map containing the configuration properties

Member Function Documentation

◆ Authenticate()

override void IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.Authenticate ( IClient  client)
inlinevirtual

Perform the necessary authentication steps for the specified request.

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

◆ GetToken()

string IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.GetToken ( )
inlineprotected

This function returns an access token. The source of the token is determined by the following logic:

  1. If user provides their own managed access token, assume it is valid and send it
  2. If this class is managing tokens and does not yet have one, or the token is expired, make a request for one
  3. If this class is managing tokens and has a valid token stored, send it
Returns
the valid access token

◆ RequestToken()

DetailedResponse<CloudPakForDataTokenResponse> IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.RequestToken ( )
inlineprotected

◆ Validate()

override void IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.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.Cp4d.CloudPakForDataAuthenticator.AuthenticationType
get

◆ Client

IClient IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.Client
getset

◆ DisableSslVerification

bool IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.DisableSslVerification
getset

◆ Headers

Dictionary<string, string> IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.Headers
getset

◆ Password

string IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.Password
get

◆ Url

string IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.Url
get

◆ Username

string IBM.Cloud.SDK.Core.Authentication.Cp4d.CloudPakForDataAuthenticator.Username
get

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