Class BaseService
- java.lang.Object
-
- io.jans.ca.plugin.adminui.service.BaseService
-
- Direct Known Subclasses:
AUIConfigurationService,LicenseDetailsService,OAuth2Service
public class BaseService extends Object
-
-
Constructor Summary
Constructors Constructor Description BaseService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DCRResponseexecuteDCR(String ssaJwt)Performs Dynamic Client Registration (DCR) using the provided Software Statement Assertion (SSA).io.jans.as.client.TokenResponsegetToken(io.jans.as.client.TokenRequest tokenRequest, String tokenEndpoint)Obtain an access token from the authorization server using the provided token request.io.jans.as.client.TokenResponsegetToken(io.jans.as.client.TokenRequest tokenRequest, String tokenEndpoint, String userInfoJwt)Request an access token from the token endpoint using the provided TokenRequest.Optional<Map<String,Object>>introspectToken(String accessToken, String introspectionEndpoint)Perform token introspection against the given introspection endpoint.
-
-
-
Method Detail
-
getToken
public io.jans.as.client.TokenResponse getToken(io.jans.as.client.TokenRequest tokenRequest, String tokenEndpoint)Obtain an access token from the authorization server using the provided token request.- Parameters:
tokenRequest- the token request parameters (may include grant type, code, verifier, client credentials, etc.)tokenEndpoint- the token endpoint URL to send the request to- Returns:
- a TokenResponse containing the token data on success, or
nullon failure
-
getToken
public io.jans.as.client.TokenResponse getToken(io.jans.as.client.TokenRequest tokenRequest, String tokenEndpoint, String userInfoJwt)Request an access token from the token endpoint using the provided TokenRequest. Builds a form using fields fromtokenRequest(code, scope, code_verifier, grant_type, redirect_uri, client_id) and includesuserInfoJwtas theujwtparameter when present, then POSTs the form totokenEndpointusing the client credentials intokenRequest.- Parameters:
tokenRequest- contains values used to construct the token request (authorization code, scope, PKCE verifier, grant type, redirect URI, client identifier, and encoded client credentials)tokenEndpoint- the URL of the authorization server token endpoint to which the request will be sentuserInfoJwt- optional JWT to include as theujwtform parameter when present- Returns:
- a
io.jans.as.client.TokenResponsepopulated from the server JSON on HTTP 200,nullotherwise
-
executeDCR
public DCRResponse executeDCR(String ssaJwt)
Performs Dynamic Client Registration (DCR) using the provided Software Statement Assertion (SSA).- Parameters:
ssaJwt- the SSA JWT issued by the Scan server- Returns:
- a DCRResponse containing the registered client's ID, secret, issuer (opHost), hardwareId, and scan hostname when registration succeeds; `null` if registration fails
-
introspectToken
public Optional<Map<String,Object>> introspectToken(String accessToken, String introspectionEndpoint) throws NoSuchAlgorithmException, KeyManagementException
Perform token introspection against the given introspection endpoint.- Parameters:
accessToken- the access token to be introspectedintrospectionEndpoint- the full URL of the introspection endpoint- Returns:
- an Optional containing the introspection response as a Map when the server returns HTTP 200, `Optional.empty()` otherwise
- Throws:
NoSuchAlgorithmException- if a required cryptographic algorithm is unavailable when building the HTTP clientKeyManagementException- if an error occurs initializing key management for the HTTP client
-
-