Skip to content

SudoSOS Back-end API / GEWIS / GewisAuthenticationController

Class: GewisAuthenticationController ​

The GEWIS authentication controller is responsible for:

  • Verifying user authentications.
  • Handing out json web tokens.

Extends ​

Constructors ​

Constructor ​

ts
new GewisAuthenticationController(
   options, 
   tokenHandler, 
   gewiswebSecret): GewisAuthenticationController;

Creates a new authentication controller instance.

Parameters ​

ParameterTypeDescription
optionsBaseControllerOptionsThe options passed to the base controller.
tokenHandlerTokenHandlerThe token handler for creating signed tokens.
gewiswebSecretstringThe shared JWT secret with gewisweb.

Returns ​

GewisAuthenticationController

Overrides ​

BaseController.constructor

Properties ​

PropertyModifierTypeDescriptionInherited from
roleManagerprotectedRoleManagerA reference to the role manager passed in the base controller options.BaseController.roleManager
specificationpublicSwaggerSpecificationA reference to the swagger specification passed in the base controller options.BaseController.specification

Methods ​

getGEWISWebPublic() ​

ts
getGEWISWebPublic(req, res): Promise<void>;

GET /authentication/gewisweb

Parameters ​

ParameterType
reqRequest
resResponse

Returns ​

Promise<void>

200 - Public key

Operation Id ​

getGEWISWebPublic

Tags ​

authenticate - Operations of authentication controller


getPolicy() ​

ts
getPolicy(): Policy;

Gets the policy defined by child classes. This policy includes all routes that the controller accepts, the authorization middleware, and the final handler function for every route.

Returns ​

Policy

The policy of this controller.

Overrides ​

BaseController.getPolicy


getRouter() ​

ts
getRouter(): Router;

Returns ​

Router

the router used by this controller.

Inherited from ​

BaseController.getRouter


gewiswebLogin() ​

ts
gewiswebLogin(req, res): Promise<void>;

POST /authentication/gewisweb

Parameters ​

ParameterType
reqRequest
resResponse

Returns ​

Promise<void>

200 - The created json web token.

Operation Id ​

gewisWebAuthentication

Tags ​

authenticate - Operations of authentication controller


ldapLogin() ​

ts
ldapLogin(req, res): Promise<void>;

POST /authentication/GEWIS/LDAP

Parameters ​

ParameterType
reqRequest
resResponse

Returns ​

Promise<void>

200 - The created json web token.

Operation Id ​

gewisLDAPAuthentication

Tags ​

authenticate - Operations of authentication controller