Skip to content

AuthenticationContext Class ​

Definition ​

Authentication to use against a ServiceNow instance

  • Namespace: JASE.ServiceNow
  • Assembly: JASE.ServiceNow.dll

Properties ​

NameDescription
ApiKeySpecifies the API key used for authenticating with the ServiceNow API when Mode ==ApiKey.
ApiKeyHeaderSpecifies the Request Header for API Key authentication. (Default: x-sn-apikey)
CredentialsGets the credentials used for authenticating with the ServiceNow API when Mode == BasicAuth.
DefaultReturns the process-wide default authentication context.
ModeSpecifies the default Authentication mode when accessing a ServiceNow instance. (Default: BasicAuth)
TokenGets the credentials used for authenticating with the ServiceNow API when Mode == OAuthBearer.

Methods ​

NameDescription
AuthenticationContext CreateApiKey(string apiKey, string apiHeader = null)Creates an authentication context that uses an API key passed in a request header.
AuthenticationContext CreateAuthToken(AuthenticationToken token)Creates an authentication context that uses OAuth Bearer authentication.
AuthenticationContext CreateAuthToken(AuthenticationTokenResult result)Creates an authentication context that uses OAuth Bearer authentication.
AuthenticationContext CreateBasicAuth(string username, string password)Creates an authentication context that uses HTTP Basic authentication.
void SetDefault(AuthenticationContext defaultContext)Sets the process-wide default authentication context.