Class SsaService


  • @Named
    public class SsaService
    extends java.lang.Object
    Provides SSA methods to save, update, search, etc.
    • Constructor Summary

      Constructors 
      Constructor Description
      SsaService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      jakarta.ws.rs.core.Response.ResponseBuilder createNotAcceptableResponse()
      Create a Response.ResponseBuilder with status 406
      jakarta.ws.rs.core.Response.ResponseBuilder createUnprocessableEntityResponse()
      Create a Response.ResponseBuilder with status 422
      io.jans.as.common.model.ssa.Ssa findSsaByJti​(java.lang.String jti)
      Find SSA based on "jti"
      io.jans.as.model.jwt.Jwt generateJwt​(io.jans.as.common.model.ssa.Ssa ssa, ExecutionContext executionContext, io.jans.as.model.config.WebKeysConfiguration webKeysConfiguration, io.jans.as.model.crypto.AbstractCryptoProvider cryptoProvider)
      Generates a new JWT using a given SSA.
      java.util.List<io.jans.as.common.model.ssa.Ssa> getSsaList​(java.lang.String jti, java.lang.Long orgId, io.jans.as.common.model.ssa.SsaState status, java.lang.String clientId, java.lang.String[] scopes)
      Get list of SSAs based on "jti", "org_id" or "status" filters
      void merge​(io.jans.as.common.model.ssa.Ssa ssa)
      Updates an existing SSA in the database
      void persist​(io.jans.as.common.model.ssa.Ssa ssa)
      Persist SSA in to the database
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SsaService

        public SsaService()
    • Method Detail

      • 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

        public io.jans.as.common.model.ssa.Ssa findSsaByJti​(java.lang.String jti)
        Find SSA based on "jti"

        Method returns null if the SSA is not found.

        Parameters:
        jti - Unique identifier
        Returns:
        Ssa found
      • getSsaList

        public java.util.List<io.jans.as.common.model.ssa.Ssa> getSsaList​(java.lang.String jti,
                                                                          java.lang.Long orgId,
                                                                          io.jans.as.common.model.ssa.SsaState status,
                                                                          java.lang.String clientId,
                                                                          java.lang.String[] scopes)
        Get list of SSAs based on "jti", "org_id" or "status" filters

        If the client only has ssa.portal scope, then it is filtered by the client that created the SSA

        Parameters:
        jti - Unique identifier
        orgId - Organization ID
        status - Status
        clientId - Client ID
        scopes - 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,
                                                    io.jans.as.model.config.WebKeysConfiguration webKeysConfiguration,
                                                    io.jans.as.model.crypto.AbstractCryptoProvider cryptoProvider)
        Generates a new JWT using a given SSA.

        Method throws an RuntimeException if it fails to create the jwt

        Method executes a postProcessor in case it has been sent in the execution context parameter.

        Parameters:
        ssa - Ssa
        executionContext - Execution context
        webKeysConfiguration - Web keys configuration
        cryptoProvider - Crypto provider
        Returns:
        Jwt with SSA structure
      • createUnprocessableEntityResponse

        public jakarta.ws.rs.core.Response.ResponseBuilder createUnprocessableEntityResponse()
        Create a Response.ResponseBuilder with status 422
        Returns:
        Response builder
      • createNotAcceptableResponse

        public jakarta.ws.rs.core.Response.ResponseBuilder createNotAcceptableResponse()
        Create a Response.ResponseBuilder with status 406
        Returns:
        Response builder