- Enginio Manual
- Enginio C++ Classes and Examples
- EnginioOAuth2Authentication
- Enginio 1.2.1 Reference Documentation

# EnginioOAuth2Authentication Class

Represents a user that is authenticated directly by the backend using OAuth2 standard. More...

Header: | #include <EnginioOAuth2Authentication>
Since: | Qt 5.3
Inherits: | EnginioIdentity

- List of all members, including inherited members

## Properties

- password : QString
- user : QString

## Public Functions

| EnginioOAuth2Authentication(QObject * parent = 0)
| ~EnginioOAuth2Authentication()
QString | password() const
QString | user() const

## Public Slots

void | setPassword(const QString & password)
void | setUser(const QString & user)

## Signals

void | passwordChanged(const QString & password)
void | userChanged(const QString & user)

## Detailed Description

Represents a user that is authenticated directly by the backend using OAuth2 standard.

This class can authenticate a user by verifying the user's login and password. The user has to exist in the backend already.

To authenticate an instance of EnginioClient called client such code may be used:

    EnginioOAuth2Authentication *identity = new EnginioOAuth2Authentication(client);
    identity->setUser(_user);
    identity->setPassword(_password);

    client->setIdentity(identity);

Setting the identity will trigger an asynchronous request, resulting in EnginioClient::authenticationState() changing.

See also EnginioClientConnection::authenticationState(), EnginioClientConnection::identity(), EnginioClient::sessionAuthenticated(), EnginioClient::sessionAuthenticationError(), and EnginioClient::sessionTerminated().

## Property Documentation

### password : QString

This property contains the password used for authentication.

Access functions:

QString | password() const
void | setPassword(const QString & password)

Notifier signal:

void | passwordChanged(const QString & password)

### user : QString

This property contains the user name used for authentication.

Access functions:

QString | user() const
void | setUser(const QString & user)

Notifier signal:

void | userChanged(const QString & user)

## Member Function Documentation

### EnginioOAuth2Authentication::EnginioOAuth2Authentication(QObject * parent = 0)

Constructs a EnginioPasswordOAuth2 instance with parent as QObject parent.

### EnginioOAuth2Authentication::~EnginioOAuth2Authentication()

Destructs this EnginioPasswordOAuth2 instance.