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 validated
-
-
-
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 status401and key UNAUTHORIZED_CLIENT if you don't have the scope.
-
getValidSsaByJti
public io.jans.as.common.model.ssa.Ssa getValidSsaByJti(String jti)
Find SSA based on "jti" and validatedThis method returns
WebApplicationExceptionwith status 422 if the SSA does not exist or if it is in state (expired, used or revoked). Otherwise it will return the valid SSA- Parameters:
jti- Unique identifier- Returns:
- Ssa valid
-
-