Package io.jans.as.server.ssa.ws.rs
Class SsaRestWebServiceValidator
- java.lang.Object
-
- io.jans.as.server.ssa.ws.rs.SsaRestWebServiceValidator
-
@Named public class SsaRestWebServiceValidator extends Object
Provides methods to validate different params about SSA.
-
-
Constructor Summary
Constructors Constructor Description SsaRestWebServiceValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckScopesPolicy(io.jans.as.common.model.registration.Client client, String scope)Check if the client has the given scope.voidcheckScopesPolicy(io.jans.as.common.model.registration.Client client, List<String> scopeList)Check if the client has at least one scope from the list of scopes.io.jans.as.common.model.registration.ClientgetClientFromSession()Get client from sessionio.jans.as.common.model.ssa.SsagetValidSsaByJti(String jti)Find SSA based on "jti" and validatedvoidvalidateSsaCreateRequest(io.jans.as.client.ssa.create.SsaCreateRequest createRequest)Validate SSA Metadata
-
-
-
Method Detail
-
getClientFromSession
public io.jans.as.common.model.registration.Client getClientFromSession() throws jakarta.ws.rs.WebApplicationExceptionGet client from session- Returns:
Clientif obtained.- Throws:
jakarta.ws.rs.WebApplicationException- with status401and key INVALID_CLIENT if the client cannot be obtained.
-
checkScopesPolicy
public void checkScopesPolicy(io.jans.as.common.model.registration.Client client, String scope) throws jakarta.ws.rs.WebApplicationExceptionCheck if the client has the given scope.- Parameters:
client- Client to check scopescope- Scope to validate- Throws:
jakarta.ws.rs.WebApplicationException- with status401and key UNAUTHORIZED_CLIENT if you don't have the scope.
-
checkScopesPolicy
public void checkScopesPolicy(io.jans.as.common.model.registration.Client client, List<String> scopeList) throws jakarta.ws.rs.WebApplicationExceptionCheck if the client has at least one scope from the list of scopes.- Parameters:
client- Client to check scopescopeList- List of scope to validated- Throws:
jakarta.ws.rs.WebApplicationException- with status401 (Unauthorized)with unauthorized_client key, when it does not have the scope.
-
getValidSsaByJti
public io.jans.as.common.model.ssa.Ssa getValidSsaByJti(String jti)
Find SSA based on "jti" and validated- Parameters:
jti- Unique identifier- Returns:
- A Ssa validated
- Throws:
jakarta.ws.rs.WebApplicationException- with status400 (Bad Request) with <b>invalid_jti<b/> key, when jti does not exist, is invalid or state is in (expired, used or revoked)
-
validateSsaCreateRequest
public void validateSsaCreateRequest(io.jans.as.client.ssa.create.SsaCreateRequest createRequest)
Validate SSA MetadataThis method validates the metadata of a new SSA. - "lifetime" cannot be 0 or negative
- Parameters:
createRequest- SSA Metadata- Throws:
jakarta.ws.rs.WebApplicationException- with status400 (Bad Request)with invalid_ssa_metadata key, when lifetime is invalid
-
-