Class SignInRegistrations

java.lang.Object
org.jwcarman.who.oidc.SignInRegistrations

public final class SignInRegistrations extends Object
The client registrations who signs people in with, each with the issuer its credentials are stored under. Only authorization_code registrations take part; one that cannot be signed in with safely fails with InvalidRegistrationException.
  • Method Details

    • of

      public static SignInRegistrations of(Iterable<org.springframework.security.oauth2.client.registration.ClientRegistration> clientRegistrations, Map<String, ProviderSettings> settings)
      Reads the sign-in registrations.
      Parameters:
      clientRegistrations - the application's client registrations
      settings - who.oidc.providers, by registration id
      Returns:
      the registrations who signs in with
      Throws:
      InvalidRegistrationException - when one cannot be signed in with safely
    • find

      public Optional<SignInRegistration> find(String registrationId)
      Finds a registration by id.
      Parameters:
      registrationId - the client registration id
      Returns:
      the registration, or empty when who does not sign in with it
    • name

      public String name(String registrationId)
      The name a person knows a registration by, its client name, such as GitHub. Spring Security makes it the registration id when the application sets none.
      Parameters:
      registrationId - the client registration id
      Returns:
      the client name, or the id when who does not sign in with the registration
    • isEmpty

      public boolean isEmpty()
      Whether there are no registrations to sign in with.
      Returns:
      true when there are none
    • all

      Every registration, in the order the application declared them.
      Returns:
      the registrations