Robot Raconteur Core C++ Library
Loading...
Searching...
No Matches
RobotRaconteur::UserAuthenticator Class Referenceabstract

Base class for user authenticators. More...

#include <Security.h>

Inheritance diagram for RobotRaconteur::UserAuthenticator:
RobotRaconteur::PasswordFileUserAuthenticator

Public Member Functions

virtual boost::shared_ptr< AuthenticatedUserAuthenticateUser (boost::string_ref username, const std::map< std::string, boost::intrusive_ptr< RRValue > > &credentials, const boost::shared_ptr< ServerContext > &context, const boost::shared_ptr< ITransportConnection > &transport)=0
 Authenticate a user using username and credentials.

Detailed Description

Base class for user authenticators.

Used with ServiceSecurityPolicy to secure services

Override AuthenticateUser to implement different types of user authenticators.

Member Function Documentation

◆ AuthenticateUser()

virtual boost::shared_ptr< AuthenticatedUser > RobotRaconteur::UserAuthenticator::AuthenticateUser ( boost::string_ref username,
const std::map< std::string, boost::intrusive_ptr< RRValue > > & credentials,
const boost::shared_ptr< ServerContext > & context,
const boost::shared_ptr< ITransportConnection > & transport )
pure virtual

Authenticate a user using username and credentials.

The service will call AuthenticateUser when clients attempt to authenticate. The username and credentials are passed to RobotRaconteurNode::ConnectService() or RobotRaconteurNode::AsyncConnectService(). The authenticator must analyze these values to decide how to authenticate the user.

On successful authentication, return a populated AuthenticatedUser object. On failure, throw an exception.

See Security for more information.

Parameters
usernameThe username provided by the client
credentialsThe credentials provided by the client
contextThe context of the service requesting authentication
Returns
RR_SHARED_PTR<AuthenticatedUser> An authenticated user object

Implemented in RobotRaconteur::PasswordFileUserAuthenticator.


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