Class RelyingPartyRegistration

java.lang.Object
com.codename1.backend.security.saml2.RelyingPartyRegistration

public final class RelyingPartyRegistration extends Object

One identity provider this server accepts SAML 2.0 sign-ins from, and how this server presents itself to it.

RelyingPartyRegistration okta = RelyingPartyRegistration.withRegistrationId("okta")
    .assertingPartyEntityId("http://www.okta.com/exk...")
    .singleSignOnServiceLocation("https://corp.okta.com/app/.../sso/saml")
    .verificationCertificate(Certificate.fromPem(oktaCertPem))
    .build();

or from the identity provider's metadata, with RelyingPartyRegistrations.fromMetadataLocation(String, String) or RelyingPartyRegistrations.fromMetadata(String, String). {baseUrl} and {registrationId} in the two addresses of this side are filled in from the request; give whole addresses in production, because {baseUrl} is read from the Host the browser sent.

  • Field Details

  • Method Details

    • withRegistrationId

      public static RelyingPartyRegistration.Builder withRegistrationId(String registrationId)
    • mutate

      A builder holding everything this registration holds, to change some of it.
    • getRegistrationId

      public String getRegistrationId()
    • getEntityId

      public String getEntityId()
      This server's entity ID, possibly a template.
    • getAssertionConsumerServiceLocation

      public String getAssertionConsumerServiceLocation()
      Where the identity provider posts its response, possibly a template.
    • getSigningKey

      public byte[] getSigningKey()
      The key AuthnRequests are signed with, PKCS#8 DER; null when they are not.
    • getSigningCertificate

      public Certificate getSigningCertificate()
      The certificate of getSigningKey(), published in this server's metadata.
    • getNameIdFormat

      public String getNameIdFormat()
      The NameID format asked for; null to let the identity provider choose.
    • getAssertingPartyEntityId

      public String getAssertingPartyEntityId()
    • getSingleSignOnServiceLocation

      public String getSingleSignOnServiceLocation()
    • getSingleSignOnServiceBinding

      public String getSingleSignOnServiceBinding()
    • isWantAuthnRequestsSigned

      public boolean isWantAuthnRequestsSigned()
    • getVerificationCertificates

      public List<Certificate> getVerificationCertificates()
      The certificates whose keys may sign a response; several during a rollover.
    • isSha1Allowed

      public boolean isSha1Allowed()
      Whether SHA-1 signatures and digests are accepted from this provider.
    • getClockSkewMillis

      public long getClockSkewMillis()
      How far apart the two clocks may be when validity times are checked.
    • getDecryptionKeys

      public List<byte[]> getDecryptionKeys()
      The PKCS#8 keys an encrypted assertion may be encrypted to, in the order they are tried; empty when assertions must arrive in the clear.
    • getDecryptionCertificates

      public List<Certificate> getDecryptionCertificates()
      The certificates of getDecryptionKeys(), published in this server's metadata for the identity provider to encrypt to.
    • getSingleLogoutServiceLocation

      public String getSingleLogoutServiceLocation()
      Where the identity provider sends logout requests and responses to this server, possibly a template.
    • getSingleLogoutServiceResponseLocation

      public String getSingleLogoutServiceResponseLocation()
      Where the identity provider sends its logout responses, possibly a template.
    • getAssertingPartySingleLogoutServiceLocation

      public String getAssertingPartySingleLogoutServiceLocation()
      The identity provider's logout address; null when it has none, and a sign-out then ends the session here alone.
    • getAssertingPartySingleLogoutServiceResponseLocation

      public String getAssertingPartySingleLogoutServiceResponseLocation()
      Where this server sends its answer to the identity provider's logout request: the provider's ResponseLocation, or its logout address.
    • getAssertingPartySingleLogoutServiceBinding

      public String getAssertingPartySingleLogoutServiceBinding()
      REDIRECT, the default, or POST.