Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jans-auth-server): Token Status List support #8620

Merged
merged 67 commits into from
Jun 28, 2024

Merge branch 'main' into jans-auth-server-8562

799831e
Select commit
Loading
Failed to load commit list.
Merged

feat(jans-auth-server): Token Status List support #8620

Merge branch 'main' into jans-auth-server-8562
799831e
Select commit
Loading
Failed to load commit list.
DryRunSecurity / Authn/Authz Analyzer succeeded Jun 28, 2024 in 11s

DryRun Security

Details

Authn/Authz Analyzer Findings: 23 detected

⚠️ Potential Authn/Authz Function Used or Modified agama/transpiler/src/main/java/io/jans/agama/dsl/Transpiler.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code imports several classes related to authentication and authorization, such as AuthnFlowLexer, AuthnFlowParser, and RecognitionErrorListener. This suggests that the code potentially contains functions or logic related to authentication and authorization flows.
Filename agama/transpiler/src/main/java/io/jans/agama/dsl/Transpiler.java
CodeLink
import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;
import io.jans.agama.antlr.AuthnFlowLexer;
import io.jans.agama.antlr.AuthnFlowParser;
import io.jans.agama.dsl.error.RecognitionErrorListener;
import io.jans.agama.dsl.error.SyntaxException;
import net.sf.saxon.dom.NodeOverNodeInfo;
import net.sf.saxon.s9api.*;
import net.sf.saxon.sapling.SaplingDocument;
import org.antlr.v4.runtime.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.nio.charset.StandardCharsets.UTF_8;
public class Transpiler {
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/client/src/main/java/io/jans/as/client/OpenIdConfigurationClient.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains several functions that are related to authentication and authorization, such as 'setAuthorizationEndpoint', 'setTokenEndpoint', 'setRevocationEndpoint', and 'setSessionRevocationEndpoint'. These functions are likely part of an OpenID Connect or OAuth 2.0 implementation, which are authentication and authorization protocols used to secure web applications.
Filename jans-auth-server/client/src/main/java/io/jans/as/client/OpenIdConfigurationClient.java
CodeLink
response.setIssuer(jsonObj.optString(ISSUER, null));
response.setAuthorizationEndpoint(jsonObj.optString(AUTHORIZATION_ENDPOINT, null));
response.setAuthorizationChallengeEndpoint(jsonObj.optString(AUTHORIZATION_CHALLENGE_ENDPOINT, null));
response.setStatusListEndpoint(jsonObj.optString(STATUS_LIST_ENDPOINT, null));
response.setTokenEndpoint(jsonObj.optString(TOKEN_ENDPOINT, null));
response.setRevocationEndpoint(jsonObj.optString(REVOCATION_ENDPOINT, null));
response.setSessionRevocationEndpoint(jsonObj.optString(SESSION_REVOCATION_ENDPOINT, null));
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/client/src/main/java/io/jans/as/client/OpenIdConfigurationResponse.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains several fields that are typically associated with authentication and authorization functions in web applications, such as 'authorizationEndpoint', 'tokenEndpoint', 'revocationEndpoint', and 'sessionRevocationEndpoint'. These endpoints are commonly used in OAuth 2.0 and OpenID Connect protocols for authentication and authorization purposes.
Filename jans-auth-server/client/src/main/java/io/jans/as/client/OpenIdConfigurationResponse.java
CodeLink
private String issuer;
private String authorizationEndpoint;
private String authorizationChallengeEndpoint;
private String statusListEndpoint;
private String tokenEndpoint;
private String revocationEndpoint;
private String sessionRevocationEndpoint;
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/client/src/main/java/io/jans/as/client/OpenIdConfigurationResponse.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains a method named 'setAuthorizationChallengeEndpoint', which suggests that it is related to authorization or authentication functionality. This method sets the 'authorizationChallengeEndpoint' property, which is likely used in the authentication or authorization process.
Filename jans-auth-server/client/src/main/java/io/jans/as/client/OpenIdConfigurationResponse.java
CodeLink
this.authorizationChallengeEndpoint = authorizationChallengeEndpoint;
}
/**
* Gets status list
*
* @return status list
*/
public String getStatusListEndpoint() {
return statusListEndpoint;
}
/**
* Sets status list
*
* @param statusListEndpoint status list
*/
public void setStatusListEndpoint(String statusListEndpoint) {
this.statusListEndpoint = statusListEndpoint;
}
/**
* Returns the URL of the Token endpoint.
*
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/client/src/main/java/io/jans/as/client/OpenIdConfigurationResponse.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains several variables and methods that are commonly associated with authentication and authorization processes. The variables authorizationEndpoint, authorizationChallengeEndpoint, tokenEndpoint, revocationEndpoint, and userInfoEndpoint are typically used in OAuth 2.0 and OpenID Connect flows, which are authentication and authorization protocols. These endpoints are used for various steps in the authentication and authorization process, such as obtaining access tokens, revoking tokens, and retrieving user information. Therefore, this code likely contains functions related to authentication and authorization.
Filename jans-auth-server/client/src/main/java/io/jans/as/client/OpenIdConfigurationResponse.java
CodeLink
"issuer='" + issuer + '\'' +
", authorizationEndpoint='" + authorizationEndpoint + '\'' +
", authorizationChallengeEndpoint='" + authorizationChallengeEndpoint + '\'' +
", statusListEndpoint='" + statusListEndpoint + '\'' +
", tokenEndpoint='" + tokenEndpoint + '\'' +
", revocationEndpoint='" + revocationEndpoint + '\'' +
", userInfoEndpoint='" + userInfoEndpoint + '\'' +
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/model/src/main/java/io/jans/as/model/common/FeatureFlagType.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains feature flags related to authentication and authorization, such as 'GLOBAL_TOKEN_REVOCATION' and 'ACTIVE_SESSION'. These feature flags suggest that the codebase includes functions or endpoints that handle token revocation and active session management, which are typically part of authentication and authorization mechanisms in web applications.
Filename jans-auth-server/model/src/main/java/io/jans/as/model/common/FeatureFlagType.java
CodeLink
@DocFeatureFlag(description = "Enable/Disable global token revocation endpoint",
defaultValue = "Enabled")
GLOBAL_TOKEN_REVOCATION("global_token_revocation"),
@DocFeatureFlag(description = "Enable/Disable status list endpoint",
defaultValue = "Enabled")
STATUS_LIST("status_list"),
@DocFeatureFlag(description = "Enable/Disable active session endpoint",
defaultValue = "Enabled")
ACTIVE_SESSION("active_session"),
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/model/src/main/java/io/jans/as/model/common/GrantType.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains the GrantType enum, which includes the UMA_TICKET value. This grant type is related to the OAuth 2.0 User-Managed Access (UMA) protocol, which is used for authentication and authorization purposes. The description for the UMA_TICKET grant type indicates that it is used to gain access to a protected resource, suggesting that it is part of an authentication or authorization process.
Filename jans-auth-server/model/src/main/java/io/jans/as/model/common/GrantType.java
CodeLink
* an OAuth 2.0 access token to gain access to a protected resource
* asynchronously from the time a resource owner grants access.
*/
UMA_TICKET("urn:ietf:params:oauth:grant-type:uma-ticket"),
/**
* Token exchange grant type for OAuth 2.0
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/model/src/main/java/io/jans/as/model/config/BaseDnConfiguration.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code includes fields related to authentication and authorization, such as 'fido2Assertion' and 'archivedJwks'. These fields suggest that the code is handling data used for authentication and authorization processes, such as JSON Web Tokens (JWT) and FIDO2 assertions, which are commonly used in authentication and authorization mechanisms.
Filename jans-auth-server/model/src/main/java/io/jans/as/model/config/BaseDnConfiguration.java
CodeLink
private String fido2Assertion;
@XmlElement(name = "archivedJwks")
private String archivedJwks;
@XmlElement(name = "node")
private String node;
@XmlElement(name = "statusIndexPool")
private String statusIndexPool;
public String getArchivedJwks() {
return archivedJwks;
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/model/src/main/java/io/jans/as/model/config/Constants.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The provided Java code defines several constants related to authentication and authorization, such as AUTHORIZATION, AUTHORIZATION_BEARER, and AUTHORIZATION_BASIC. These constants suggest that the application is likely handling authentication and authorization-related functionality, such as processing authorization headers or working with Bearer tokens or Basic authentication.
Filename jans-auth-server/model/src/main/java/io/jans/as/model/config/Constants.java
CodeLink
public static final String CONTENT_TYPE_APPLICATION_JSON_UTF_8 = "application/json;charset=UTF-8";
public static final String CONTENT_TYPE_STATUSLIST_JSON = "application/statuslist+json";
public static final String CONTENT_TYPE_STATUSLIST_JWT = "application/statuslist+jwt";
public static final String AUTHORIZATION = "Authorization";
public static final String AUTHORIZATION_BEARER = "Authorization: Bearer ";
public static final String AUTHORIZATION_BASIC = "Authorization: Basic ";
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/model/src/main/java/io/jans/as/model/configuration/AppConfiguration.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code includes imports for several classes that are commonly associated with authentication and authorization mechanisms, such as io.jans.as.model.common.* and io.jans.as.model.crypto.signature.SignatureAlgorithm. These classes may contain functions or methods related to authentication and authorization, such as handling user credentials, managing sessions, or verifying digital signatures.
Filename jans-auth-server/model/src/main/java/io/jans/as/model/configuration/AppConfiguration.java
CodeLink
import com.google.common.collect.Lists;
import io.jans.agama.model.EngineConfig;
import io.jans.as.model.common.*;
import io.jans.as.model.crypto.signature.SignatureAlgorithm;
import io.jans.as.model.error.ErrorHandlingMethod;
import io.jans.as.model.jwk.KeySelectionStrategy;
import io.jans.as.model.ssa.SsaConfiguration;
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/model/src/main/java/io/jans/as/model/configuration/AppConfiguration.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains methods related to JWT (JSON Web Token) configuration, which is commonly used for authentication and authorization purposes. The methods getStatusListResponseJwtLifetime(), setStatusListResponseJwtLifetime(int), getStatusListResponseJwtSignatureAlgorithm(), and setStatusListResponseJwtSignatureAlgorithm(String) suggest that the application is using JWT for authentication or authorization purposes, such as securing API responses or managing user sessions.
Filename jans-auth-server/model/src/main/java/io/jans/as/model/configuration/AppConfiguration.java
CodeLink
this.spontaneousScopeLifetime = spontaneousScopeLifetime;
}
public int getStatusListResponseJwtLifetime() {
return statusListResponseJwtLifetime;
}
public void setStatusListResponseJwtLifetime(int statusListResponseJwtLifetime) {
this.statusListResponseJwtLifetime = statusListResponseJwtLifetime;
}
public String getStatusListResponseJwtSignatureAlgorithm() {
return statusListResponseJwtSignatureAlgorithm;
}
public void setStatusListResponseJwtSignatureAlgorithm(String statusListResponseJwtSignatureAlgorithm) {
this.statusListResponseJwtSignatureAlgorithm = statusListResponseJwtSignatureAlgorithm;
}
public int getStatusListBitSize() {
return statusListBitSize;
}
public void setStatusListBitSize(int statusListBitSize) {
this.statusListBitSize = statusListBitSize;
}
public int getStatusListIndexAllocationBlockSize() {
return statusListIndexAllocationBlockSize;
}
public void setStatusListIndexAllocationBlockSize(int statusListIndexAllocationBlockSize) {
this.statusListIndexAllocationBlockSize = statusListIndexAllocationBlockSize;
}
public int getCleanServiceInterval() {
return cleanServiceInterval;
}
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/model/src/main/java/io/jans/as/model/configuration/ConfigurationResponseClaim.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains several constants that are commonly associated with authentication and authorization functionality in web applications, such as AUTHORIZATION_ENDPOINT, AUTHORIZATION_CHALLENGE_ENDPOINT, TOKEN_ENDPOINT, REVOCATION_ENDPOINT, and SESSION_REVOCATION_ENDPOINT. These endpoints are typically used in the process of authenticating users and managing their access to the application.
Filename jans-auth-server/model/src/main/java/io/jans/as/model/configuration/ConfigurationResponseClaim.java
CodeLink
public static final String ISSUER = "issuer";
public static final String AUTHORIZATION_ENDPOINT = "authorization_endpoint";
public static final String AUTHORIZATION_CHALLENGE_ENDPOINT = "authorization_challenge_endpoint";
public static final String STATUS_LIST_ENDPOINT = "status_list_endpoint";
public static final String TOKEN_ENDPOINT = "token_endpoint";
public static final String REVOCATION_ENDPOINT = "revocation_endpoint";
public static final String SESSION_REVOCATION_ENDPOINT = "session_revocation_endpoint";
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/model/src/main/java/io/jans/as/model/jwt/JwtType.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code appears to contain an enumeration named 'JwtType' which includes several values related to authentication and authorization, such as 'JWT', 'TX_TOKEN', 'DPOP_PLUS_JWT', and 'STATUS_LIST_JWT'. These types of JWT (JSON Web Token) are commonly used for authentication and authorization purposes in web applications, so the presence of this enumeration suggests that the code may contain functions or logic related to authentication and authorization.
Filename jans-auth-server/model/src/main/java/io/jans/as/model/jwt/JwtType.java
CodeLink
JWT("JWT"),
TX_TOKEN("txn_token"),
DPOP_PLUS_JWT("dpop+jwt"),
STATUS_LIST_JWT("statuslist+jwt");
private final String paramName;
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AbstractAuthorizationGrant.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains a class named 'AbstractAuthorizationGrant' which suggests that it is related to authorization or authentication. The class contains properties such as 'claims', 'dpopJkt', 'referenceId', and 'acrValues' which are commonly associated with authentication and authorization processes.
Filename jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AbstractAuthorizationGrant.java
CodeLink
private String claims;
private String dpopJkt;
private String referenceId;
private Integer statusListIndex;
private String acrValues;
private String sessionDn;
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code imports various classes and interfaces related to authentication and authorization, such as io.jans.as.common.model.registration.Client, io.jans.as.model.authzdetails.AuthzDetails, and io.jans.as.model.common.FeatureFlagType. These suggest that the code likely contains functions or methods related to handling authentication and authorization processes.
Filename jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java
CodeLink
import io.jans.as.common.model.registration.Client;
import io.jans.as.common.service.AttributeService;
import io.jans.as.model.authzdetails.AuthzDetails;
import io.jans.as.model.common.FeatureFlagType;
import io.jans.as.model.common.ScopeConstants;
import io.jans.as.model.config.WebKeysConfiguration;
import io.jans.as.model.crypto.signature.SignatureAlgorithm;
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains imports for several classes related to authentication and authorization, such as ExternalIntrospectionContext, ExternalUpdateTokenContext, StatusListIndexService, and StatusListService. These classes suggest that the code is likely handling authentication and authorization functionality, such as token management, status checking, and external integration for authentication and authorization purposes.
Filename jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java
CodeLink
import io.jans.as.server.service.external.context.ExternalIntrospectionContext;
import io.jans.as.server.service.external.context.ExternalUpdateTokenContext;
import io.jans.as.server.service.stat.StatService;
import io.jans.as.server.service.token.StatusListIndexService;
import io.jans.as.server.service.token.StatusListService;
import io.jans.as.server.util.ServerUtil;
import io.jans.as.server.util.TokenHashUtil;
import io.jans.model.metric.MetricType;
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code appears to contain the AuthorizationGrant class, which suggests it is related to authorization functionality. The class also contains several fields that are typically associated with authentication and authorization, such as errorResponseFactory, statusListService, and statusListIndexService. These fields indicate that the class is likely responsible for handling authorization-related functionality in the application.
Filename jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java
CodeLink
@Inject
private ErrorResponseFactory errorResponseFactory;
@Inject
private StatusListService statusListService;
@Inject
private StatusListIndexService statusListIndexService;
private boolean isCachedWithNoPersistence = false;
protected AuthorizationGrant() {
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The provided code contains a function named createAccessTokenAsJwt, which is likely responsible for generating an access token in the form of a JSON Web Token (JWT). The creation of access tokens is a core part of the authentication and authorization process, as access tokens are used to verify the identity and permissions of users or clients.
Filename jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java
CodeLink
}
Audience.setAudience(jwt.getClaims(), getClient());
statusListService.addStatusClaimWithIndex(jwt, context);
if (isTrue(client.getAttributes().getRunIntrospectionScriptBeforeJwtCreation())) {
runIntrospectionScriptAndInjectValuesIntoJwt(jwt, context);
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains functions related to authentication and authorization. The createIdTokenInternal method is responsible for creating an ID token, which is a key component of the authentication and authorization process. The method appears to be handling the creation of the ID token based on various input parameters such as AuthorizationCode, AccessToken, and RefreshToken, which are all related to authentication and authorization.
Filename jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java
CodeLink
private IdToken createIdTokenInternal(AuthorizationCode authorizationCode, AccessToken accessToken, RefreshToken refreshToken, ExecutionContext executionContext) throws Exception {
executionContext.initFromGrantIfNeeded(this);
Integer statusListIndex = null;
if (errorResponseFactory.isFeatureFlagEnabled(FeatureFlagType.STATUS_LIST)) {
statusListIndex = statusListIndexService.next();
executionContext.setStatusListIndex(statusListIndex);
}
JsonWebResponse jwr = idTokenFactory.createJwr(this, authorizationCode, accessToken, refreshToken, executionContext);
final IdToken idToken = new IdToken(jwr.toString(), jwr.getClaims().getClaimAsDate(JwtClaimName.ISSUED_AT),
jwr.getClaims().getClaimAsDate(JwtClaimName.EXPIRATION_TIME));
idToken.setReferenceId(executionContext.getTokenReferenceId());
idToken.setStatusListIndex(statusListIndex);
if (log.isTraceEnabled())
log.trace("Created id_token: {}", idToken.getCode());
return idToken;
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains a method called 'asTokenEntity' that appears to be related to managing authentication or authorization tokens. The method is taking an 'AbstractToken' object as input and creating a 'TokenEntity' object from it. This suggests that the code is dealing with authentication or authorization-related functionality, such as generating, storing, or verifying tokens.
Filename jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrant.java
CodeLink
result.setClientId(getClientId());
result.setReferenceId(token.getReferenceId());
result.getAttributes().setStatusListIndex(token.getStatusListIndex());
result.getAttributes().setX5cs256(token.getX5ts256());
result.getAttributes().setDpopJkt(getDpopJkt());
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrantList.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code snippet contains a method called asGrant that appears to be related to authorization. The method is taking a TokenEntity object as a parameter, which suggests that it is part of an authentication or authorization flow. Additionally, the method is setting various properties on the returned AuthorizationGrant object, such as dpopJkt, tokenEntity, referenceId, and statusListIndex, which are likely used for authentication and authorization purposes.
Filename jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrantList.java
CodeLink
result.setDpopJkt(tokenEntity.getAttributes().getDpopJkt());
result.setTokenEntity(tokenEntity);
result.setReferenceId(tokenEntity.getReferenceId());
result.setStatusListIndex(tokenEntity.getAttributes().getStatusListIndex());
if (StringUtils.isNotBlank(grantId)) {
result.setGrantId(grantId);
}
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrantList.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The provided Java code appears to contain functions related to authentication and authorization. The code is handling various types of tokens such as authorization code grants, refresh tokens, access tokens, transaction tokens, and ID tokens, which are commonly used in authentication and authorization processes. The presence of these token-related functions and the associated logic suggests that the code is part of an implementation that deals with authentication and authorization mechanisms.
Filename jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AuthorizationGrantList.java
CodeLink
final AuthorizationCodeGrant g = (AuthorizationCodeGrant) result;
code.setX5ts256(g.getX5ts256());
code.setReferenceId(tokenEntity.getReferenceId());
code.setStatusListIndex(tokenEntity.getAttributes().getStatusListIndex());
g.setAuthorizationCode(code);
}
break;
case REFRESH_TOKEN:
final RefreshToken refreshToken = new RefreshToken(tokenEntity.getTokenCode(), tokenEntity.getCreationDate(), tokenEntity.getExpirationDate());
refreshToken.setX5ts256(result.getX5ts256());
refreshToken.setReferenceId(tokenEntity.getReferenceId());
refreshToken.setStatusListIndex(tokenEntity.getAttributes().getStatusListIndex());
result.setRefreshTokens(Collections.singletonList(refreshToken));
break;
case ACCESS_TOKEN:
final AccessToken accessToken = new AccessToken(tokenEntity.getTokenCode(), tokenEntity.getCreationDate(), tokenEntity.getExpirationDate());
accessToken.setDpop(tokenEntity.getDpop());
accessToken.setX5ts256(result.getX5ts256());
accessToken.setReferenceId(tokenEntity.getReferenceId());
accessToken.setStatusListIndex(tokenEntity.getAttributes().getStatusListIndex());
result.setAccessTokens(Collections.singletonList(accessToken));
break;
case TX_TOKEN:
final TxToken txToken = new TxToken(tokenEntity.getTokenCode(), tokenEntity.getCreationDate(), tokenEntity.getExpirationDate());
txToken.setDpop(tokenEntity.getDpop());
txToken.setX5ts256(result.getX5ts256());
txToken.setReferenceId(tokenEntity.getReferenceId());
txToken.setStatusListIndex(tokenEntity.getAttributes().getStatusListIndex());
result.setTxTokens(Collections.singletonList(txToken));
break;
case ID_TOKEN:
final IdToken idToken = new IdToken(tokenEntity.getTokenCode(), tokenEntity.getCreationDate(), tokenEntity.getExpirationDate());
idToken.setX5ts256(result.getX5ts256());
idToken.setReferenceId(tokenEntity.getReferenceId());
idToken.setStatusListIndex(tokenEntity.getAttributes().getStatusListIndex());
result.setIdToken(idToken);
break;
case LONG_LIVED_ACCESS_TOKEN:
final AccessToken longLivedAccessToken = new AccessToken(tokenEntity.getTokenCode(), tokenEntity.getCreationDate(), tokenEntity.getExpirationDate());
longLivedAccessToken.setX5ts256(result.getX5ts256());
longLivedAccessToken.setReferenceId(tokenEntity.getReferenceId());
longLivedAccessToken.setStatusListIndex(tokenEntity.getAttributes().getStatusListIndex());
result.setLongLivedAccessToken(longLivedAccessToken);
break;
}
⚠️ Potential Authn/Authz Function Used or Modified jans-auth-server/server/src/main/java/io/jans/as/server/model/common/ExecutionContext.java (click for details)
Type Potential Authn/Authz Function Used or Modified
Description The code contains a nonce and state fields, which are commonly used in authentication and authorization flows, such as OAuth 2.0 and OpenID Connect. The nonce is typically used to prevent replay attacks, while the state is used to maintain state between the client and the server during the authentication process. Additionally, the tokenReferenceId field, which is generated using a random UUID, could also be used for authentication or authorization purposes, such as for generating access tokens or refresh tokens.
Filename jans-auth-server/server/src/main/java/io/jans/as/server/model/common/ExecutionContext.java
CodeLink
private String nonce;
private String state;
private String tokenReferenceId = IdUtil.randomShortUUID();
private Integer statusListIndex;
private boolean includeIdTokenClaims;