org.keycloak.services.clientregistration.policy.impl

## Class TrustedHostClientRegistrationPolicy

- java.lang.Object
- - org.keycloak.services.clientregistration.policy.impl.TrustedHostClientRegistrationPolicy

- All Implemented Interfaces:
    Provider, ClientRegistrationPolicy

      public class TrustedHostClientRegistrationPolicy
      extends Object
      implements ClientRegistrationPolicy

  Author:
    Marek Posolda

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TrustedHostClientRegistrationPolicy(KeycloakSession session, ComponentModel componentModel)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterRegister(ClientRegistrationContext context, ClientModel clientModel)`
    `void` | `afterUpdate(ClientRegistrationContext context, ClientModel clientModel)`
    `void` | `beforeDelete(ClientRegistrationProvider provider, ClientModel clientModel)`
    `void` | `beforeRegister(ClientRegistrationContext context)`
    `void` | `beforeUpdate(ClientRegistrationContext context, ClientModel clientModel)`
    `void` | `beforeView(ClientRegistrationProvider provider, ClientModel clientModel)`
    `protected void` | `checkURLTrusted(String url, List<String> trustedHosts, List<String> trustedDomains)`
    `protected List<String>` | `getTrustedDomains()`
    `protected List<String>` | `getTrustedHosts()`
    `protected void` | `verifyClientUrls(ClientRegistrationContext context)`
    `protected void` | `verifyHost()`
    `protected String` | `verifyHostInTrustedDomains(String hostAddress, List<String> trustedDomains)`
    `protected String` | `verifyHostInTrustedHosts(String hostAddress, List<String> trustedHosts)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy

      `close`

- - ### Constructor Detail

    - #### TrustedHostClientRegistrationPolicy

          public TrustedHostClientRegistrationPolicy(KeycloakSession session,
                                                     ComponentModel componentModel)

  - ### Method Detail

    - #### beforeRegister

          public void beforeRegister(ClientRegistrationContext context)
                              throws ClientRegistrationPolicyException

      Specified by:
        `beforeRegister` in interface `ClientRegistrationPolicy`
      Throws:
        `ClientRegistrationPolicyException`

    - #### afterRegister

          public void afterRegister(ClientRegistrationContext context,
                                    ClientModel clientModel)

      Specified by:
        `afterRegister` in interface `ClientRegistrationPolicy`

    - #### beforeUpdate

          public void beforeUpdate(ClientRegistrationContext context,
                                   ClientModel clientModel)
                            throws ClientRegistrationPolicyException

      Specified by:
        `beforeUpdate` in interface `ClientRegistrationPolicy`
      Throws:
        `ClientRegistrationPolicyException`

    - #### afterUpdate

          public void afterUpdate(ClientRegistrationContext context,
                                  ClientModel clientModel)

      Specified by:
        `afterUpdate` in interface `ClientRegistrationPolicy`

    - #### beforeView

          public void beforeView(ClientRegistrationProvider provider,
                                 ClientModel clientModel)
                          throws ClientRegistrationPolicyException

      Specified by:
        `beforeView` in interface `ClientRegistrationPolicy`
      Throws:
        `ClientRegistrationPolicyException`

    - #### beforeDelete

          public void beforeDelete(ClientRegistrationProvider provider,
                                   ClientModel clientModel)
                            throws ClientRegistrationPolicyException

      Specified by:
        `beforeDelete` in interface `ClientRegistrationPolicy`
      Throws:
        `ClientRegistrationPolicyException`

    - #### verifyHost

          protected void verifyHost()
                             throws ClientRegistrationPolicyException

      Throws:
        `ClientRegistrationPolicyException`

    - #### getTrustedHosts

          protected List<String> getTrustedHosts()

    - #### getTrustedDomains

          protected List<String> getTrustedDomains()

    - #### verifyHostInTrustedHosts

          protected String verifyHostInTrustedHosts(String hostAddress,
                                                    List<String> trustedHosts)

    - #### verifyHostInTrustedDomains

          protected String verifyHostInTrustedDomains(String hostAddress,
                                                      List<String> trustedDomains)

    - #### verifyClientUrls

          protected void verifyClientUrls(ClientRegistrationContext context)
                                   throws ClientRegistrationPolicyException

      Throws:
        `ClientRegistrationPolicyException`

    - #### checkURLTrusted

          protected void checkURLTrusted(String url,
                                         List<String> trustedHosts,
                                         List<String> trustedDomains)
                                  throws ClientRegistrationPolicyException

      Throws:
        `ClientRegistrationPolicyException`

Copyright © 2021 JBoss by Red Hat. All rights reserved.