Class OpenIdRegistrationServiceImpl

java.lang.Object
ch.tocco.nice2.sso.impl.OpenIdRegistrationServiceImpl
All Implemented Interfaces:
OpenIdRegistrationService

@Component public class OpenIdRegistrationServiceImpl extends Object implements OpenIdRegistrationService
  • Constructor Details

  • Method Details

    • getMatchingPrincipal

      public Optional<Entity> getMatchingPrincipal(@Nullable String emailAddress)
      Description copied from interface: OpenIdRegistrationService
      Searchs for a matching principal using a given emailAddress 1. Checks if there is a principal with the emailAddress as 'username' if so, return this Principal 2. Checks if there exactly one Principal that is linked with a user using the given emailAddress. If so, return it.
      Specified by:
      getMatchingPrincipal in interface OpenIdRegistrationService
      Returns:
      identified principal or absent if we were not able to find a unique match
    • registerOpenIdUser

      public String registerOpenIdUser(Entity provider, Entity principal, String subject, String sourceUri)
      Description copied from interface: OpenIdRegistrationService
      Saves the registration data to a "Openid_link_information" entity and returns the generated uuid.
      Specified by:
      registerOpenIdUser in interface OpenIdRegistrationService
      Returns:
      the generated uuid
    • sendRegistrationMail

      public String sendRegistrationMail(Entity principal, @Nullable String registrationIdentifier, String uuid) throws MailException
      Description copied from interface: OpenIdRegistrationService
      Sends the registration mail (email template "sso_registration_mail") Resolves the user linked to the principal and uses this user as mail recipient. If no email address is set on the user, the registrationIdentifier is used as fallback email address.
      Specified by:
      sendRegistrationMail in interface OpenIdRegistrationService
      Parameters:
      principal - the target principal to notify
      registrationIdentifier - the registration identifier that was used to resolve the principal
      uuid - the registration uuid (return value of registerOpenIdUser)
      Returns:
      the email address to which the email was sent
      Throws:
      MailException