RoboCupMS

Public Member Functions | List of all members
com.robogames.RoboCupMS.Security.AuthControler Class Reference

## Public Member Functions
Response | login (@RequestBody LoginObj loginObj)
Response | getOAuth2URI ( @RequestParam(defaultValue="https://localhost/auth/oauth2/code") String redirectURI)
Response | oAuth2GenerateToken (@RequestParam String redirectURI, @RequestParam String code)
Response | logout ()
Response | register (@RequestBody RegistrationObj newUser)

## Member Function Documentation

## ◆ getOAuth2URI()

Response com.robogames.RoboCupMS.Security.AuthControler.getOAuth2URI | ( | @RequestParam(defaultValue="https://localhost/auth/oauth2/code") String | redirectURI | ) |
| inline

Vygeneruje odkaz pro autorizaci a autentizaci uzivatele. Po uspesne autorizaci je uzivatel presmerovan na specifikovanou adresu. Zde musi byt odeslan POST request na endpoint serveru "/auth/oAuth2GenerateToken" s parametrem "code" a "redirectURI" jejihz hodnuty ziska aktualni URL. "redirectURI" bude predan parametrem "state".

Parameters

  redirectURI | Presmerovani na URL "frond-end" -> pres JS predat autorizacni kod serveru "oAuth2GenerateToken

Returns
  URL odkaz pro autorizaci a autentizaci uzivatele

Exceptions

  Exception |

## ◆ login()

Response com.robogames.RoboCupMS.Security.AuthControler.login | ( | @RequestBody LoginObj | loginObj | ) |
| inline

Prihlaseni uzivatele do systemu (pokud je email a heslo spravne tak vygeneruje, navrati a zapise do databaze pristupovy token pro tohoto uzivatele). Token se stava automaticky neplatnym po uplynuti definovaneho casu "GlobalConfig.TOKEN_VALIDITY_DURATION".

Parameters

  email | Email uzivatele
  password | Heslo uzivatele

Returns
  Pristupovy token

## ◆ logout()

Response com.robogames.RoboCupMS.Security.AuthControler.logout | ( |  | ) |
| inline

Odhlasi uzivatele ze systemu (odstrani pristupovy token z databaze)

Parameters

  email | Email uzivatele

Returns
  Status

## ◆ oAuth2GenerateToken()

Response com.robogames.RoboCupMS.Security.AuthControler.oAuth2GenerateToken | ( | @RequestParam String | redirectURI,
|  | @RequestParam String | code
| ) |  |
| inline

Vygeneruje pristupovy token pro uzivatele s vyuzitim OAuth2 autorizacniho kodu

Parameters

  redirectURI | URI presmerovani, zistka paramatru state spolu s autorizacnim kodem
  code | Autorizacni kod pro klienta

Returns
  Pristupovy token uzivatele

## ◆ register()

Response com.robogames.RoboCupMS.Security.AuthControler.register | ( | @RequestBody RegistrationObj | newUser | ) |
| inline

Registruje noveho uzivatele

Parameters

  newUser | Registracni udaje noveho uzivatele

Returns
  Nove vytvoreni uzivatel

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

- /home/martin/Programing/RoboCupMS/src/main/java/com/robogames/RoboCupMS/Security/AuthControler.java