Package io.jans.as.server.ssa.ws.rs
Class SsaService
java.lang.Object
io.jans.as.server.ssa.ws.rs.SsaService
Provides SSA methods to save, update, search, etc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response.ResponseBuilderCreate aResponse.ResponseBuilderwith status 406jakarta.ws.rs.core.Response.ResponseBuilderCreate aResponse.ResponseBuilderwith status 422voidfillPayload(io.jans.as.model.jwt.JwtClaims claims, io.jans.as.common.model.ssa.Ssa ssa) io.jans.as.common.model.ssa.SsafindSsaByJti(String jti) Find SSA based on "jti"io.jans.as.model.jwt.JwtgenerateJwt(io.jans.as.common.model.ssa.Ssa ssa) Generates a new JWT using a given SSA.io.jans.as.model.jwt.JwtgenerateJwt(io.jans.as.common.model.ssa.Ssa ssa, ExecutionContext executionContext) Generates a new JWT using a given SSA.List<io.jans.as.common.model.ssa.Ssa>getSsaList(String jti, String orgId, io.jans.as.common.model.ssa.SsaState status, String clientId, String[] scopes) Get list of SSAs based on "jti", "org_id" or "status" filtersvoidmerge(io.jans.as.common.model.ssa.Ssa ssa) Updates an existing SSA in the databasevoidpersist(io.jans.as.common.model.ssa.Ssa ssa) Persist SSA in to the database
-
Constructor Details
-
SsaService
public SsaService()
-
-
Method Details
-
persist
public void persist(io.jans.as.common.model.ssa.Ssa ssa) Persist SSA in to the database- Parameters:
ssa- New SSA that should be created.
-
merge
public void merge(io.jans.as.common.model.ssa.Ssa ssa) Updates an existing SSA in the database- Parameters:
ssa- SSA to be updated.
-
findSsaByJti
Find SSA based on "jti"Method returns null if the SSA is not found.
- Parameters:
jti- Unique identifier- Returns:
Ssafound
-
getSsaList
public List<io.jans.as.common.model.ssa.Ssa> getSsaList(String jti, String orgId, io.jans.as.common.model.ssa.SsaState status, String clientId, String[] scopes) Get list of SSAs based on "jti", "org_id" or "status" filtersIf the client only has ssa.portal scope, then it is filtered by the client that created the SSA
- Parameters:
jti- Unique identifierorgId- Organization IDstatus- StatusclientId- Client IDscopes- List of scope- Returns:
- List of SSA
-
generateJwt
public io.jans.as.model.jwt.Jwt generateJwt(io.jans.as.common.model.ssa.Ssa ssa, ExecutionContext executionContext) throws Exception Generates a new JWT using a given SSA.Method throws an
Exceptionif it fails to generate JWTMethod executes a postProcessor in case it has been sent in the execution context parameter.
- Parameters:
ssa- SsaexecutionContext- Execution context- Returns:
- Jwt with SSA structure
- Throws:
Exception
-
generateJwt
public io.jans.as.model.jwt.Jwt generateJwt(io.jans.as.common.model.ssa.Ssa ssa) throws io.jans.as.model.exception.CryptoProviderException, io.jans.as.model.exception.InvalidJwtException Generates a new JWT using a given SSA.Method throws an
CryptoProviderExceptionorInvalidJwtExceptionif it fails to generate JWT- Parameters:
ssa- Ssa- Returns:
- Jwt with SSA structure
- Throws:
io.jans.as.model.exception.CryptoProviderExceptionio.jans.as.model.exception.InvalidJwtException
-
fillPayload
public void fillPayload(io.jans.as.model.jwt.JwtClaims claims, io.jans.as.common.model.ssa.Ssa ssa) -
createUnprocessableEntityResponse
public jakarta.ws.rs.core.Response.ResponseBuilder createUnprocessableEntityResponse()Create aResponse.ResponseBuilderwith status 422- Returns:
- Response builder
-
createNotAcceptableResponse
public jakarta.ws.rs.core.Response.ResponseBuilder createNotAcceptableResponse()Create aResponse.ResponseBuilderwith status 406- Returns:
- Response builder
-