Skip to content

OAuthTokenClient Class ​

Definition ​

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

Methods ​

NameDescription
Task<AuthenticationTokenResult> GetTokenAsync(ConnectionContext context, ClientCredentialsTokenRequest request, CancellationToken cancellationToken = null)Requests an OAuth 2.0 access token from the ServiceNow token endpoint (/oauth_token.do) using the client_credentials grant.
Task<AuthenticationTokenResult> GetTokenAsync(ConnectionContext context, IOAuthTokenRequest request, CancellationToken cancellationToken = null)Requests an OAuth 2.0 access token from the ServiceNow token endpoint (/oauth_token.do) using the client_credentials grant.
Task<AuthenticationTokenResult> GetTokenAsync(ConnectionContext context, PasswordTokenRequest request, CancellationToken cancellationToken = null)Requests an OAuth 2.0 access token from the ServiceNow token endpoint (/oauth_token.do) using the resource owner password credentials grant.
Task<AuthenticationTokenResult> GetTokenAsync(ConnectionContext context, string clientId, string clientSecret, CancellationToken cancellationToken = null)Requests an OAuth 2.0 access token from the ServiceNow token endpoint (/oauth_token.do) using the client_credentials grant.
Task<AuthenticationTokenResult> GetTokenAsync(ConnectionContext context, string clientId, string clientSecret, string scope, CancellationToken cancellationToken = null)Requests an OAuth 2.0 access token from the ServiceNow token endpoint (/oauth_token.do) using the client_credentials grant.
Task<AuthenticationTokenResult> GetTokenAsync(ConnectionContext context, string clientId, string clientSecret, string username, string password, CancellationToken cancellationToken = null)Requests an OAuth 2.0 access token from the ServiceNow token endpoint (/oauth_token.do) using the password grant (resource owner password credentials).
Task<AuthenticationTokenResult> GetTokenAsync(ConnectionContext context, string clientId, string clientSecret, string username, string password, string scope, CancellationToken cancellationToken = null)Requests an OAuth 2.0 access token from the ServiceNow token endpoint (/oauth_token.do) using the password grant (resource owner password credentials).
Task<bool> RefreshAsync(AuthenticationToken token, string clientId, string clientSecret, CancellationToken cancellationToken = null)Requests a new access token using the refresh_token grant and updates the token in-place. Returns false if no refresh token is available or if the refresh attempt fails.