NAME

Authenticator::OAuthAccessToken - Class to handle authentication of AURORA REST-server by trusting a OAuth-servers access token.

SYNOPSIS

It follows the same use as the Authenticator-class. See the Authenticator placeholder class for more information.

DESCRIPTION

A class that inherits from the Authenticator placeholder class. Please see there for more information.

CONSTRUCTOR

See the Authenticator placeholder class for more information.

METHODS

define()

See description in the placeholder Authenticator-class.

validate()

Validates to the AURORA REST-server by using an OAuth access token. The access token is passed to the generate()-method for checking of the formatting.

There are certain settings from the settings-file that the Settings-instance delivers and the method expects or takes the following options:

It calls the generate()-method on the authentication string (access token) and upon successful checking and cleaning, will use the access token to connect to the resource server to get the users email- and name details. These details will be checked in the AURORA database to see if there are any matches? Upon successful match, the entity id of the user will be returned (userid).

If the user cannot be found in the AURORA database, it checks if it is allowed to create the user (see options above)? If it is allowed to create the user, it will to so in the AURORA database and set the email and then return the entity id of the newly created user as the userid.

It returns the AURORA database userid (entity id - int) of the user upon success or 0 upon user not found.

Undef is returned upon failure. Check the error()-method for more information.

See description in the placeholder Authenticator-class for more information on the framework itself.

generate()

Takes the authentication string (in this case OAuth access token) and checks the validity of the characters and cuts the length at a maximum of 4096 characters.

Returns the cleaned and accepted access token upon success.

Undef is returned upon failure. In such a case check the error()-method for more information.

See description in the placeholder Authenticator-class for more information on the framework itself.