Class CpResponse.CpResponseBuilder<C extends CpResponse,B extends CpResponse.CpResponseBuilder<C,B>>

java.lang.Object
swiss.trustbroker.saml.dto.ResponseStatus.ResponseStatusBuilder<C,B>
swiss.trustbroker.saml.dto.CpResponse.CpResponseBuilder<C,B>
Enclosing class:
CpResponse

public abstract static class CpResponse.CpResponseBuilder<C extends CpResponse,B extends CpResponse.CpResponseBuilder<C,B>> extends ResponseStatus.ResponseStatusBuilder<C,B>
  • Constructor Details

    • CpResponseBuilder

      public CpResponseBuilder()
  • Method Details

    • $fillValuesFrom

      protected B $fillValuesFrom(C instance)
      Overrides:
      $fillValuesFrom in class ResponseStatus.ResponseStatusBuilder<C extends CpResponse,B extends CpResponse.CpResponseBuilder<C,B>>
    • inResponseTo

      public B inResponseTo(String inResponseTo)
      ID of the authentication request that lead to this CP response.
      Returns:
      this.
    • nameId

      public B nameId(String nameId)
      Subject name ID.
      Returns:
      this.
    • originalNameId

      public B originalNameId(String originalNameId)
      CP Response incoming subject name ID used for internal processing.
      Returns:
      this.
    • mappedNameId

      public B mappedNameId(String mappedNameId)
      CP Response incoming subject name ID after CP side subject name mapping.
      Returns:
      this.
      Since:
      1.10.0
      See Also:
    • nameIdFormat

      public B nameIdFormat(String nameIdFormat)
      Format of the subject name ID.
      Returns:
      this.
    • subjectConfirmationMethod

      public B subjectConfirmationMethod(String subjectConfirmationMethod)
      Subject confirmation method.
      Returns:
      this.
    • authStateInstant

      public B authStateInstant(String authStateInstant)
      Issuing instant of authentication statement.
      Returns:
      this.
    • contextClasses

      public B contextClasses(List<String> contextClasses)
      Authentication context classes.
      Returns:
      this.
    • issuer

      public B issuer(String issuer)
      CP Response issuer also referred to as HomeRealm.
      Returns:
      this.
    • homeName

      public B homeName(String homeName)
      HomeName used by IdmService to query IDM.
      Returns:
      this.
    • destination

      public B destination(String destination)
      AuthnRequest.AssertionConsumerUrl from our AuthnRequest.
      Returns:
      this.
    • authLevel

      public B authLevel(String authLevel)
      Declared QoA CP side.
      Returns:
      this.
    • rpIssuer

      public B rpIssuer(String rpIssuer)
      Incoming issuer on RP side.
      Returns:
      this.
    • rpReferer

      public B rpReferer(String rpReferer)
      Incoming HTTP referrer on RP side.
      Returns:
      this.
    • rpContextClasses

      public B rpContextClasses(List<String> rpContextClasses)
      Incoming context class requirements on RP side.
      Returns:
      this.
    • rpDestination

      public B rpDestination(String rpDestination)
      Override SAML Response.Destination on RP side.
      Returns:
      this.
    • rpRecipient

      public B rpRecipient(String rpRecipient)
      Override SAML SubjectConfirmationData.Recipient on RP side.
      Returns:
      this.
    • clientExtId

      public B clientExtId(String clientExtId)
      Retrieved IDM primary reference for internal reference.
      Returns:
      this.
    • clientName

      public B clientName(String clientName)
      RelyingParty ClientName as used in the IDM credential SAML federation Issuer NameID.
      Returns:
      this.
    • applicationName

      public B applicationName(String applicationName)
      RP/OIDC context sending 'SAML clientId' in ProviderName.
      Returns:
      this.
    • oidcClientId

      public B oidcClientId(String oidcClientId)
      Incoming OIDC client_id.
      Returns:
      this.
    • oidcScopes

      public B oidcScopes(Set<String> oidcScopes)
      Incoming OIDC scopes.
      Returns:
      this.
    • customIssuer

      public B customIssuer(String customIssuer)
      Override RP response issuer.
      Returns:
      this.
    • rpContext

      public B rpContext(Map<String,String> rpContext)
      The HttpServletRequest params, some specific ones: username, Client_Network
      Returns:
      this.
    • attributes

      public B attributes(Map<Definition,List<String>> attributes)
      The attributes map contains these attributes:
      • CP SAML Response attributes extracted from the message
      • Derived attributes computed in ScriptService BeforeIdm hooks
      The names in this map are usually fully qualified as represented in the SAML response from the CP. This map is logged by the AuditService when SAML response comes in from CP.
      Returns:
      this.
    • originalAttributes

      public B originalAttributes(Map<Definition,List<String>> originalAttributes)
      Copy of Attributes before filtering. Necessary for SSO
      Returns:
      this.
    • idmLookup

      public B idmLookup(IdmLookup idmLookup)
      Contains the IdmLookup for the corresponding RP. The query list can originate from Groovy scripts.
      Returns:
      this.
    • userDetails

      public B userDetails(Map<Definition,List<String>> userDetails)
      IDM user data returned from IDM backends, filtered by RP setup.
      Returns:
      this.
    • originalUserDetailsCount

      public B originalUserDetailsCount(int originalUserDetailsCount)
      Returns:
      this.
    • properties

      public B properties(Map<Definition,List<String>> properties)
      Properties contain computed values that can be sent as RP attributes based on incoming CP attributes and userdetails. They are selected by the PropertiesSelection configuration.
      Returns:
      this.
    • originalPropertiesCount

      public B originalPropertiesCount(int originalPropertiesCount)
      Returns:
      this.
    • results

      public B results(Map<Definition,List<String>> results)
      The results map contains these SAML attributes:
      • CP SAML Response attributes extracted from the message (PassThrough Claims from CP)
      • Derived attributes computed in ScriptService BeforeIdm hooks (Computed CP claims)
      • IDM attributes retrieved from the IDMService
      • Derived attributes computed in ScriptService AfterIdm hooks (Computed IDM claims)
      The names in this map are usually fully qualified as represented in the SAML response from the CP. This map is logged by the AuditService when SAML response is sent to RP. Type system in SAML: Strings and List>String> only. Results are used for auditing only at the time being.
      Returns:
      this.
    • claims

      public B claims(Map<String,Object> claims)
      The claims map contains these OIDC claims:
      • Everything that was annotated with an oidcName in the configuration.
      • All well known OIDC claims of the openid scope declared in AttributeName (StandardClaims).
      • Everything added or removed in a OIDC OnToken groovy script hook.
      We use Object values because of nested collection support. Type system in SAML: Any object that supports JSONAware (json serialization) or a toString conversion otherwise. Claims are used for OIDC token generation as opposed to results (different type system).
      Returns:
      this.
    • additionalIdmData

      public B additionalIdmData(Map<Object,Object> additionalIdmData)
      Additional exchanged between related API implementations.
      This data is not persisted.
      The map key indicates the source of the value item.
      Returns:
      this.
      See Also:
      • IdmResult.getAdditionalData()
      • IdmProvisioningRequest.getAdditionalData()
    • queriedStores

      public B queriedStores(Set<String> queriedStores)
      Contains the stores of IDM lookups actually executed by the available IdmQueryService implementations - including those that did not find a result.
      Returns:
      this.
      Since:
      1.12.0
      See Also:
      • ()
      • IdmProvisioningRequest.getQueriedStores()
    • self

      protected abstract B self()
      Specified by:
      self in class ResponseStatus.ResponseStatusBuilder<C extends CpResponse,B extends CpResponse.CpResponseBuilder<C,B>>
    • build

      public abstract C build()
      Specified by:
      build in class ResponseStatus.ResponseStatusBuilder<C extends CpResponse,B extends CpResponse.CpResponseBuilder<C,B>>
    • toString

      public String toString()
      Overrides:
      toString in class ResponseStatus.ResponseStatusBuilder<C extends CpResponse,B extends CpResponse.CpResponseBuilder<C,B>>