10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::oidc::DefaultOIDCBrowserFlowAuthenticationRequest Class Reference

#include <DefaultOIDCBrowserFlowAuthenticationRequest.h>

Detailed Description

Default browser-based OIDC authentication request.

Inheritance diagram for tenduke::oidc::DefaultOIDCBrowserFlowAuthenticationRequest:
tenduke::oidc::BaseOIDCRequest tenduke::oidc::OIDCBrowserFlowAuthenticationRequest tenduke::oidc::OIDCAuthenticationRequest

Public Member Functions

 DefaultOIDCBrowserFlowAuthenticationRequest (std::unique_ptr< const tenduke::oauth::OAuthBrowserAuthorizationRequest > oauthRequest, const std::shared_ptr< const tenduke::oidc::OIDCConfiguration > &oidcConfiguration, const std::string &nonce, const std::shared_ptr< const tenduke::jwt::JWTParser > &parseJWT)
 Constructs new instance.
 
std::string buildAuthenticationRequestUrl () const override
 Creates the initial authenticationrequest URL.
 
std::unique_ptr< tenduke::oidc::OIDCStatehandleCallback (const std::string &redirectURI) const override
 Handles callback: performs consequent actions to authenticate.
 
- Public Member Functions inherited from tenduke::oidc::BaseOIDCRequest
 BaseOIDCRequest (const std::shared_ptr< const tenduke::oidc::OIDCConfiguration > &oidcConfiguration, const std::shared_ptr< const tenduke::jwt::JWTParser > &jwtParser, std::string nonce)
 Constructs new instance.
 

Additional Inherited Members

- Protected Member Functions inherited from tenduke::oidc::BaseOIDCRequest
virtual std::unique_ptr< tenduke::oidc::OIDCStatetoOIDCState (tenduke::oauth::OAuthState &oauthState) const
 Creates OIDCState from OAuthState.
 
virtual tenduke::oidc::IdToken parseIdToken (const std::string &serializedIdToken, const std::string &expectedNonce) const
 Parses id token.
 
- Protected Attributes inherited from tenduke::oidc::BaseOIDCRequest
const std::shared_ptr< const tenduke::oidc::OIDCConfigurationoidcConfiguration
 OIDC-configuration.
 
const std::shared_ptr< const tenduke::jwt::JWTParserparseJWT
 JWT parser.
 

Constructor & Destructor Documentation

◆ DefaultOIDCBrowserFlowAuthenticationRequest()

tenduke::oidc::DefaultOIDCBrowserFlowAuthenticationRequest::DefaultOIDCBrowserFlowAuthenticationRequest ( std::unique_ptr< const tenduke::oauth::OAuthBrowserAuthorizationRequest oauthRequest,
const std::shared_ptr< const tenduke::oidc::OIDCConfiguration > &  oidcConfiguration,
const std::string &  nonce,
const std::shared_ptr< const tenduke::jwt::JWTParser > &  parseJWT 
)

Constructs new instance.

Parameters
oauthRequest-
oidcConfiguration-
nonce-
parseJWT-

Member Function Documentation

◆ buildAuthenticationRequestUrl()

std::string tenduke::oidc::DefaultOIDCBrowserFlowAuthenticationRequest::buildAuthenticationRequestUrl ( ) const
overridevirtual

Creates the initial authenticationrequest URL.

Navigate browser to this URL.

Returns
-

Implements tenduke::oidc::OIDCBrowserFlowAuthenticationRequest.

◆ handleCallback()

std::unique_ptr<::OIDCState > tenduke::oidc::DefaultOIDCBrowserFlowAuthenticationRequest::handleCallback ( const std::string &  redirectURI) const
overridevirtual

Handles callback: performs consequent actions to authenticate.

See documentation of method tenduke::oauth::OAuthRequest::handleCallback().

The call is synchronous.

Parameters
redirectURIthis is the redirect-URI to which the OIDC server requested the browser to navigate to after the login was successful or in case of some error. The redirect-URI contains all the necessary parameters to finalize the login
Returns
state describing the login session
Exceptions
std::nested_exceptionwhen the there is some nested cause
tenduke::http::HTTPException(or subclasses of it) when the server responds with HTTP error status code which does not indicate OAuth-error, e.g. 500 (internal server error) or 404 (not found = wrong endpoint configured)
tenduke::json::JSONParsingExceptionwhen server response is not valid JSON
tenduke::oauth::OAuthExceptionwhen the server response is not what we expected, e.g.
  • problems with the redirectURI (missing or invalid "state", missing "code")
  • The token response does not contain access_token
  • The token response payload is not JSON-object
tenduke::oauth::OAuthServerErrorwhen the server responds with an error
tenduke::net::NetworkingException(or subclasses of it) when networking error occurred, e.g.
tenduke::net::URLExceptionif problem parsing the redirectURI (should not happen, though)
tenduke::net::MalformedURLExceptionif the redirectURI is invalid

Implements tenduke::oidc::OIDCBrowserFlowAuthenticationRequest.


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