Skip to content

Codeunit WSB_OAuth2AppHelper

Exposes procedures to assist with OAuth 2.0 application setup/configuration.

Properties

Name Value
Access Public

Methods

wgFncApplyDefaultOAuth2Settings

Applies default settings to a OAuth 2.0 Application record.

Parameters

Type Name Description
Record "WSB_OAuth2Application" vRecWSB_OAuth2Application The OAuth 2.0 Application record.

wgFncIgnoreTokenCache

Sets whether to disable token caching.

Parameters

Type Name Description
Boolean pIgnoreTokenCache Whether to ignore token caching.

wgFncGetAccessToken

Retrieves the stored access token for an application.

Parameters

Type Name Description
Record "WSB_OAuth2Application" pRecWSB_OAuth2Application The application to get the stored access token for.

Returns

Type Description
Text Access Token

wgFncHasClientSecret

Retrieves whether or not a client secret has been entered for an OAuth2-authenticated application.

Parameters

Type Name Description
Record "WSB_OAuth2Application" pRecWSB_OAuth2Application The application.

Returns

Type Description
Boolean true if a client secret value exists for the application.

wgFncHasPassword

Retrieves whether or not a password exists for an OAuth2-authenticated application.

Parameters

Type Name Description
Record "WSB_OAuth2Application" pRecWSB_OAuth2Application The application.

Returns

Type Description
Boolean true if a password exists for the application.

wgFncHasRefreshToken

Retrieves whether or not a refresh token exists for an OAuth2-authenticated application.

Parameters

Type Name Description
Record "WSB_OAuth2Application" pRecWSB_OAuth2Application The application.

Returns

Type Description
Boolean true if a refresh token exists for the application.

wgFncRefreshAccessToken

Attempts to get a new access token for an application using the stored refresh token.

Parameters

Type Name Description
Record "WSB_OAuth2Application" vRecWSB_OAuth2Application The application to get the access token for.
Text vMessageTxt A message that explains the reason for failure.

Returns

Type Description
Boolean System.Xml.XmlElement

wgFncRequestAccessToken

Checks if a new access token should be retrieved or if the currently stored one is still valid. If a new access token is needed, then it will be requested and stored.

Parameters

Type Name Description
Record "WSB_OAuth2Application" vRecWSB_OAuth2Application The application to request an access token for.
Text vMessageTxt A message that explains the reason for failure.

Returns

Type Description
Boolean System.Xml.XmlElement

wgFncSetClientSecret

Stores the Client Secret for an application.

Parameters

Type Name Description
Record "WSB_OAuth2Application" pRecWSB_OAuth2Application The application.
Text pClientSecret The client secret value.

wgFncSetPassword

Stores the user's password for an application with Password Credentials.

Parameters

Type Name Description
Record "WSB_OAuth2Application" pRecWSB_OAuth2Application The application.
Text pPassword The password value.