Overview
The SGIVU Authorization Server (sgivu-auth) provides OAuth2 and OpenID Connect functionality. It issues signed JWT tokens using a JKS keystore and manages client registrations, user authorizations, and sessions.
Base URL
sgivu-auth service.
OAuth2 Endpoints
Authorization Endpoint
The OAuth2 client identifier
The URI to redirect to after authorization
The OAuth2 response type (typically
code)Space-separated list of requested scopes (e.g.,
openid profile email)Opaque value to maintain state between request and callback
PKCE code challenge for public clients
PKCE code challenge method (S256 or plain)
Response
Redirects toredirect_uri with authorization code:
Token Endpoint
application/x-www-form-urlencoded
Authentication: Client credentials via Basic Auth header or request body
Authorization Code Grant
Must be
authorization_codeThe authorization code received from the authorization endpoint
Must match the redirect_uri used in authorization request
Required if not using Basic Auth
Required for confidential clients if not using Basic Auth
PKCE code verifier for public clients
Refresh Token Grant
Must be
refresh_tokenThe refresh token previously issued
Optional: requested scope (must be subset of original scope)
Response
The JWT access token for accessing protected resources
Always
BearerToken lifetime in seconds
Refresh token for obtaining new access tokens
Space-separated list of granted scopes
Status Codes
200 OK- Token successfully issued400 Bad Request- Invalid request parameters401 Unauthorized- Invalid client credentials
Example
JWKS Endpoint
Response
Array of JWK objects containing public keys
OpenID Connect Endpoints
Discovery Endpoint
Response
The issuer identifier URL
URL of the authorization endpoint
URL of the token endpoint
URL of the JWKS endpoint
Supported OAuth2 response types
Supported OAuth2 grant types
Supported subject identifier types
Supported signing algorithms for ID tokens
Login Endpoint
Security Considerations
JWT Signing
- JWTs are signed using RSA keys from a JKS keystore
- The keystore location and password are configured via
sgivu.jwt.keystore.locationandsgivu.jwt.keystore.password - Never commit keystore files to version control
- Use a secret manager or secure pipeline to provide the keystore in production
Default Clients
Three OAuth2 clients are registered by default:-
sgivu-gateway - Backend-for-Frontend (BFF) client
- Client ID:
sgivu-gateway - Secret: Configured via
gateway-client.secret
- Client ID:
-
postman-client - For API testing
- Client ID:
postman-client - Secret:
postman-secret
- Client ID:
-
oauth2-debugger-client - For OAuth2 debugging
- Client ID:
oauth2-debugger-client - Secret:
oauth2-debugger-secret
- Client ID:
Issuer Configuration
- Configure
ISSUER_URLto match the public hostname/URL - Issuer mismatch will cause token validation failures
- Ensure consistency between authorization server and resource servers
Error Responses
OAuth2 errors follow the standard OAuth2 error response format:Common Error Codes
invalid_request- Missing or malformed parametersinvalid_client- Client authentication failedinvalid_grant- Invalid or expired authorization codeunauthorized_client- Client not authorized for this grant typeunsupported_grant_type- Grant type not supportedinvalid_scope- Requested scope is invalid or exceeds granted scope