Package dw.customer.oauth

Contains classes for OAuth authentication flows with third-party providers.

ClassDescription
OAuthAccessTokenResponseContains OAuth-related artifacts from the HTTP response from the third-party OAuth server when requesting an access token
OAuthFinalizedResponseContains the combined responses from the third-party OAuth server when finalizing the authentication.

Contains both the OAuthAccessTokenResponse
and the OAuthUserInfoResponse
OAuthLoginFlowMgrThe OAuthLoginFlowMgr encapsulates interactions with third party OAuth providers to support the Authorization Code Flow.
The way to use is:
  • call initiateOAuthLogin(String)
  • redirect the user to the returned link
  • when the user authenticates there the server will call back to a URL configured on the provider's web site
  • when processing the request made from the provider's web site you have two choices - either call the obtainAccessToken() and obtainUserInfo(String, String) methods one after another separately (gives you more flexibility), or call the finalizeOAuthLogin() method which internally calls the other two (simpler to use).
Sample code for using it:
OAuthUserInfoResponseContains the response from the third-party OAuth server when requesting user info.