Overview
The AuthController provides REST endpoints for authentication-related operations.
Endpoints
GET /auth/login/callback
Handles the login callback from the Google OIDC provider.
Request Parameters
| Parameter | Description |
|---|---|
|
The authorization code received from Google OIDC |
Response
Returns the following fields:
| Path | Type | Description |
|---|---|---|
|
|
The access token to be used for authentication to Core API |
|
|
The expiration time of the access token in seconds |
Example Request
$ curl 'http://localhost:8080/auth/login/callback?code=auth-code' -i -X GET
Example Response
{"accessToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c","expirationInSeconds":3600}
GET /auth/me
Retrieves the details of the currently authenticated user.
Request Headers
| Name | Description |
|---|---|
|
Bearer token to authenticate the request |
Response
Returns the following fields:
| Path | Type | Description |
|---|---|---|
|
|
The employee ID of the user |
|
|
The full name of the user |
|
|
The first name of the user |
|
|
The middle name of the user, if any |
|
|
The last name of the user |
|
|
The URL of the user’s profile picture |
|
|
The email address of the user |
|
|
Indicates whether the user’s email is verified |
|
|
The mobile number of the user |
|
|
The list of roles assigned to the user |
Example Request
$ curl 'http://localhost:8080/auth/me' -i -X GET \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJyb2xlcyI6WyJBRE1JTiJdLCJpc3MiOiJ0ZXN0LWlzc3VlciIsImdpdmVuX25hbWUiOiJDYWxlbiIsIm1pZGRsZV9uYW1lIjoiTWlkZGxlIiwicGljdHVyZSI6Imh0dHA6Ly9leGFtcGxlLmNvbS9waWMuanBnIiwiYXVkIjoidGVzdC1hdWRpZW5jZSIsIm5hbWUiOiJDYWxlbiBMZWdhenBpIiwicGhvbmVfbnVtYmVyIjoiKzYzOTEyMzQ1Njc4OSIsImV4cCI6MTc0ODA4ODc2MSwiZmFtaWx5X25hbWUiOiJMZWdhenBpIiwiZW1haWwiOiJjYWxlbkBvcmFuZ2VhbmRicm9uemUuY29tIn0.Wou_NtzP3PrhntnN-5kedDBLR8o9dsJMQsy6VVbbtbY'
Example Response
{"sub":"1","name":"Calen Legazpi","givenName":"Calen","middleName":"Middle","familyName":"Legazpi","picture":"http://example.com/pic.jpg","email":"calen@orangeandbronze.com","emailVerified":false,"phoneNumber":"+639123456789","roles":["ADMIN"]}