Wt: Wt::Auth::OidcProcess Class Reference

Wt 4.10.4

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Wt::Auth::OidcProcess Class Reference

An OpenId Connect authentication process. More...

Inheritance diagram for Wt::Auth::OidcProcess:
[legend]

## Public Member Functions
virtual void | startAuthenticate () override
| Starts an authorization and authentication process.
virtual void | getIdentity (const OAuthAccessToken &token) override
| Obtains an authenticated identity.
Public Member Functions inherited from Wt::Auth::OAuthProcess
const std::string & | scope () const
| Returns the scope for which this process was created.
const OAuthService & | service () const
| Returns the OAuth service which spawned this process.
virtual void | startAuthorize ()
| Starts an authorization process.
WString | error () const
| Error information, in case authentication or identification failed.
const OAuthAccessToken & | token () const
| Returns the access token.
Signal< OAuthAccessToken > & | authorized ()
| Authorization signal.
Signal< Identity > & | authenticated ()
| Authentication signal.
Public Member Functions inherited from Wt::WObject
void | addChild (std::unique_ptr< WObject > child)
| Add a child WObject whose lifetime is determined by this WObject.
template<typename Child >
Child * | addChild (std::unique_ptr< Child > child)
| Add a child WObject, returning a raw pointer.
std::unique_ptr< WObject > | removeChild (WObject *child)
| Remove a child WObject, so its lifetime is no longer determined by this WObject.
template<typename Child >
std::unique_ptr< Child > | removeChild (Child *child)
| Remove a child WObject, so its lifetime is no longer determined by this WObject.
virtual const std::string | id () const
| Returns the (unique) identifier for this object.
virtual void | setObjectName (const std::string &name)
| Sets an object name.
virtual std::string | objectName () const
| Returns the object name.
void | resetLearnedSlots ()
| Resets learned stateless slot implementations.
template<class T >
void | resetLearnedSlot (void(T::*method)())
| Resets a learned stateless slot implementation.
template<class T >
WStatelessSlot * | implementStateless (void(T::*method)())
| Declares a slot to be stateless and learn client-side behaviour on first invocation.
template<class T >
WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)())
| Declares a slot to be stateless and learn client-side behaviour in advance.
void | isNotStateless ()
| Marks the current function as not stateless.
template<class T >
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode)
| Provides a JavaScript implementation for a method.
Public Member Functions inherited from Wt::Core::observable
| observable () noexcept
| Default constructor.
virtual | ~observable ()
| Destructor.
template<typename... Args, typename C >
auto | bindSafe (void(C::*method)(Args...)) noexcept
| Protects a method call against object destruction.
template<typename... Args, typename C >
auto | bindSafe (void(C::*method)(Args...) const) const noexcept
| Protects a const method call against object destruction.
template<typename Function >
auto | bindSafe (const Function &function) noexcept
| Protects a function against object destruction.

## Additional Inherited Members
Public Types inherited from Wt::WObject
typedef void(WObject::*) | Method()
| Typedef for a WObject method without arguments.
Static Public Member Functions inherited from Wt::WObject
Protected Member Functions inherited from Wt::Auth::OAuthProcess
| OAuthProcess (const OAuthService &service, const std::string &scope)
| Constructor.
virtual OAuthAccessToken | parseTokenResponse (const Http::Message &response)
| Parses the response for a token request.
virtual void | setError (const WString &e)
| Sets the error.
Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * | getStateless (Method method)
| On-demand stateless slot implementation.

## Detailed Description

An OpenId Connect authentication process.

The process implements the state machine that is needed to complete an OpenID Connect authentication cycle.

A process is created for a particular scope, which represents what kind of information one wants to access, and which is used to inform the user of the kind of operations he needs to authorize for your application to make with his protected data.

See also
  OidcService::createProcess()
  OAuthProcess

## Member Function Documentation

## ◆ getIdentity()

virtual void Wt::Auth::OidcProcess::getIdentity | ( | const OAuthAccessToken & | token | ) |
| overridevirtual

Obtains an authenticated identity.

The authentication process will either use the ID token included with the access token or, when this is not available, request the identity at the user info endpoint using claims.

The authentication process ends with the authenticated() signal which signals the obtained identity.

Reimplemented from Wt::Auth::OAuthProcess.

## ◆ startAuthenticate()

virtual void Wt::Auth::OidcProcess::startAuthenticate | ( |  | ) |
| overridevirtual

Starts an authorization and authentication process.

This is startAuthorize() followed by getIdentity().

The authentication process ends with the authenticated() signal which signals the obtained identity.

Note
  To be able to use a popup (instead of a page redirect), you should connect this method directly to an, since popup windows are blocked in most web browsers unless they are the direct consequence of an event.

Reimplemented from Wt::Auth::OAuthProcess.