Google Shared Contacts Manager  1.0
Semestral project for BI-ZNF
GoogleOAuth2Authenticator Class Reference

Authenticator that validates whether user is GSuite administrator so he can use this app. More...

Inheritance diagram for GoogleOAuth2Authenticator:

Public Member Functions

 __construct (OAuthService $srvc)
 
 authenticate (array $credentials)
 Method will validate that user is properly authenticated with google and he is a GSuite Administrator. More...
 
 getUserFromGoogle ()
 Ask Google for more details about authenticated user. More...
 

Data Fields

const NO_DOMAIN_FOUND = 404
 

Private Member Functions

 validateAdmin (User $user)
 Check whether authenticated user is an GSuite Administrator. More...
 

Private Attributes

 $oauth
 

Detailed Description

Authenticator that validates whether user is GSuite administrator so he can use this app.

Constructor & Destructor Documentation

◆ __construct()

__construct ( OAuthService  $srvc)

Member Function Documentation

◆ authenticate()

authenticate ( array  $credentials)

Method will validate that user is properly authenticated with google and he is a GSuite Administrator.

Parameters
array$credentialsArray that carry Google Oauth code
Returns
UserIdentity User Identity is returned if user is properly authenticated Admin
Exceptions
AuthenticationExceptionException is thrown when user is not properly authenticated or he is not an Admin

◆ getUserFromGoogle()

getUserFromGoogle ( )

Ask Google for more details about authenticated user.

Returns
User
Exceptions
AuthenticationExceptionException is thrown whenever Google does not provide information about user

◆ validateAdmin()

validateAdmin ( User  $user)
private

Check whether authenticated user is an GSuite Administrator.

Parameters
User$user
Returns
bool True when user is GSuite Admin
Exceptions
AuthenticationExceptionThrown when user is not member of domain or he is not an Admin.

Field Documentation

◆ $oauth

$oauth
private

◆ NO_DOMAIN_FOUND

const NO_DOMAIN_FOUND = 404

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