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

#include <OIDCLoginRequestWithLoopbackRedirection.h>

Detailed Description

An implementation of tenduke::sso::OIDCLogin using external browser (the OS default browser) and with "Loopback Interface Redirection" (see https://www.rfc-editor.org/rfc/rfc8252#section-7.3).

In terms of user-experience, this flow is quite obtrusive, but is relatively easy to implement in platform-independent manner. It also has the benefit of not including embedded browser, which might increase the footprint of application noticeably (and embedded browsers are not recommended nowadays, for several reasons).

This flow first starts lightweight local HTTP-server. Then the default OS browser is opened with the URL to start the login. Once the execute succeeds (or fails), the backend sends "redirect"-response to the browser. In this case, the redirect points to an HTTP URL with localhost, e.g. "http://localhost:9999/callback". The browser receives the redirect response and navigates to the URL. The local HTTP server is listening this URL and then notifies the application of the success (or failure). Finally the HTTP-server is shutdown.

Inheritance diagram for tenduke::oidc::osbrowser::OIDCLoginRequestWithLoopbackRedirection:
tenduke::oidc::OIDCLoginRequest

Public Member Functions

 OIDCLoginRequestWithLoopbackRedirection (const std::shared_ptr< const tenduke::osa::BrowserIntegration > &browser, const std::shared_ptr< tenduke::oidc::osbrowser::RedirectUriHandler > &redirectUriHandler, const std::shared_ptr< tenduke::http::server::AbstractHTTPServer > &httpServer, std::unique_ptr< const tenduke::oidc::OIDCBrowserFlowAuthenticationRequest > oidcRequest)
 Constructs new instance.
 
std::unique_ptr< tenduke::oidc::OIDCStateexecute () override
 Performs the login.
 
void abort () override
 Aborts the login.
 

Constructor & Destructor Documentation

◆ OIDCLoginRequestWithLoopbackRedirection()

tenduke::oidc::osbrowser::OIDCLoginRequestWithLoopbackRedirection::OIDCLoginRequestWithLoopbackRedirection ( const std::shared_ptr< const tenduke::osa::BrowserIntegration > &  browser,
const std::shared_ptr< tenduke::oidc::osbrowser::RedirectUriHandler > &  redirectUriHandler,
const std::shared_ptr< tenduke::http::server::AbstractHTTPServer > &  httpServer,
std::unique_ptr< const tenduke::oidc::OIDCBrowserFlowAuthenticationRequest oidcRequest 
)

Constructs new instance.

Parameters
browser-
redirectUriHandler-
httpServer-
oidcRequest-

Member Function Documentation

◆ abort()

void tenduke::oidc::osbrowser::OIDCLoginRequestWithLoopbackRedirection::abort ( )
overridevirtual

Aborts the login.

This allows another thread to abort a dangling login process.

Implements tenduke::oidc::OIDCLoginRequest.

◆ execute()

std::unique_ptr< xdoidc::OIDCState > tenduke::oidc::osbrowser::OIDCLoginRequestWithLoopbackRedirection::execute ( )
overridevirtual

Performs the login.

Returns
new OIDCState describing the user session

Implements tenduke::oidc::OIDCLoginRequest.


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