org.keycloak.forms.login.freemarker

## Class FreeMarkerLoginFormsProvider

- java.lang.Object
- - org.keycloak.forms.login.freemarker.FreeMarkerLoginFormsProvider

- All Implemented Interfaces:
    LoginFormsProvider, Provider

      public class FreeMarkerLoginFormsProvider
      extends Object
      implements LoginFormsProvider

  Author:
    Stian Thorgersen

- - ### Field Summary

    - ### Fields inherited from interface org.keycloak.forms.login.LoginFormsProvider

      `IDENTITY_PROVIDER_BROKER_CONTEXT, UPDATE_PROFILE_CONTEXT_ATTR, USERNAME_EDIT_DISABLED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FreeMarkerLoginFormsProvider(KeycloakSession session, FreeMarkerUtil freeMarker)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `LoginFormsProvider` | `addError(FormMessage errorMessage)`
    `void` | `addScript(String scriptUrl)` Adds a script to the html header
    `LoginFormsProvider` | `addSuccess(FormMessage errorMessage)` Add a success message to the form
    `void` | `close()`
    `javax.ws.rs.core.Response` | `createCode()`
    `javax.ws.rs.core.Response` | `createErrorPage()`
    `javax.ws.rs.core.Response` | `createForm(String form)`
    `javax.ws.rs.core.Response` | `createIdpLinkConfirmLinkPage()`
    `javax.ws.rs.core.Response` | `createIdpLinkEmailPage()`
    `javax.ws.rs.core.Response` | `createInfoPage()`
    `javax.ws.rs.core.Response` | `createLogin()`
    `javax.ws.rs.core.Response` | `createLoginTotp()`
    `javax.ws.rs.core.Response` | `createOAuthGrant(ClientSessionModel clientSession)`
    `javax.ws.rs.core.Response` | `createPasswordReset()`
    `javax.ws.rs.core.Response` | `createRegistration()`
    `javax.ws.rs.core.Response` | `createResponse(UserModel.RequiredAction action)`
    `javax.ws.rs.core.Response` | `createUpdateProfilePage()`
    `protected String` | `formatMessage(FormMessage message, Properties messagesBundle, Locale locale)`
    `protected String` | `getFirstMessageUnformatted()`
    `LoginFormsProvider` | `setAccessRequest(List<RoleModel> realmRolesRequested, javax.ws.rs.core.MultivaluedMap<String,RoleModel> resourceRolesRequested, List<ProtocolMapperModel> protocolMappersRequested)`
    `LoginFormsProvider` | `setAccessRequest(String accessRequestMessage)`
    `LoginFormsProvider` | `setActionUri(URI actionUri)`
    `LoginFormsProvider` | `setAttribute(String name, Object value)`
    `LoginFormsProvider` | `setClientSession(ClientSessionModel clientSession)`
    `LoginFormsProvider` | `setClientSessionCode(String accessCode)`
    `FreeMarkerLoginFormsProvider` | `setError(String message, Object... parameters)` Set one global error message.
    `LoginFormsProvider` | `setErrors(List<FormMessage> messages)` Set multiple error messages.
    `FreeMarkerLoginFormsProvider` | `setFormData(javax.ws.rs.core.MultivaluedMap<String,String> formData)`
    `FreeMarkerLoginFormsProvider` | `setInfo(String message, Object... parameters)`
    `protected void` | `setMessage(MessageType type, String message, Object... parameters)`
    `LoginFormsProvider` | `setResponseHeader(String headerName, String headerValue)`
    `LoginFormsProvider` | `setStatus(javax.ws.rs.core.Response.Status status)`
    `FreeMarkerLoginFormsProvider` | `setSuccess(String message, Object... parameters)`
    `FreeMarkerLoginFormsProvider` | `setUser(UserModel user)`

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

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

- - ### Constructor Detail

    - #### FreeMarkerLoginFormsProvider

          public FreeMarkerLoginFormsProvider(KeycloakSession session,
                                              FreeMarkerUtil freeMarker)

  - ### Method Detail

    - #### addScript

          public void addScript(String scriptUrl)

      Description copied from interface: `LoginFormsProvider`
      Adds a script to the html header
      Specified by:
        `addScript` in interface `LoginFormsProvider`

    - #### createResponse

          public javax.ws.rs.core.Response createResponse(UserModel.RequiredAction action)

      Specified by:
        `createResponse` in interface `LoginFormsProvider`

    - #### createForm

          public javax.ws.rs.core.Response createForm(String form)

      Specified by:
        `createForm` in interface `LoginFormsProvider`

    - #### createLogin

          public javax.ws.rs.core.Response createLogin()

      Specified by:
        `createLogin` in interface `LoginFormsProvider`

    - #### createPasswordReset

          public javax.ws.rs.core.Response createPasswordReset()

      Specified by:
        `createPasswordReset` in interface `LoginFormsProvider`

    - #### createLoginTotp

          public javax.ws.rs.core.Response createLoginTotp()

      Specified by:
        `createLoginTotp` in interface `LoginFormsProvider`

    - #### createRegistration

          public javax.ws.rs.core.Response createRegistration()

      Specified by:
        `createRegistration` in interface `LoginFormsProvider`

    - #### createInfoPage

          public javax.ws.rs.core.Response createInfoPage()

      Specified by:
        `createInfoPage` in interface `LoginFormsProvider`

    - #### createUpdateProfilePage

          public javax.ws.rs.core.Response createUpdateProfilePage()

      Specified by:
        `createUpdateProfilePage` in interface `LoginFormsProvider`

    - #### createIdpLinkConfirmLinkPage

          public javax.ws.rs.core.Response createIdpLinkConfirmLinkPage()

      Specified by:
        `createIdpLinkConfirmLinkPage` in interface `LoginFormsProvider`

    - #### createIdpLinkEmailPage

          public javax.ws.rs.core.Response createIdpLinkEmailPage()

      Specified by:
        `createIdpLinkEmailPage` in interface `LoginFormsProvider`

    - #### createErrorPage

          public javax.ws.rs.core.Response createErrorPage()

      Specified by:
        `createErrorPage` in interface `LoginFormsProvider`

    - #### createOAuthGrant

          public javax.ws.rs.core.Response createOAuthGrant(ClientSessionModel clientSession)

      Specified by:
        `createOAuthGrant` in interface `LoginFormsProvider`

    - #### createCode

          public javax.ws.rs.core.Response createCode()

      Specified by:
        `createCode` in interface `LoginFormsProvider`

    - #### setMessage

          protected void setMessage(MessageType type,
                                    String message,
                                    Object... parameters)

    - #### getFirstMessageUnformatted

          protected String getFirstMessageUnformatted()

    - #### formatMessage

          protected String formatMessage(FormMessage message,
                                         Properties messagesBundle,
                                         Locale locale)

    - #### setError

          public FreeMarkerLoginFormsProvider setError(String message,
                                                       Object... parameters)

      Description copied from interface: `LoginFormsProvider`
      Set one global error message.
      Specified by:
        `setError` in interface `LoginFormsProvider`
      Parameters:
        `message` - key of message
        `parameters` - to be formatted into message

    - #### setErrors

          public LoginFormsProvider setErrors(List<FormMessage> messages)

      Description copied from interface: `LoginFormsProvider`
      Set multiple error messages.
      Specified by:
        `setErrors` in interface `LoginFormsProvider`
      Parameters:
        `messages` - to be set

    - #### addError

          public LoginFormsProvider addError(FormMessage errorMessage)

      Specified by:
        `addError` in interface `LoginFormsProvider`

    - #### addSuccess

          public LoginFormsProvider addSuccess(FormMessage errorMessage)

      Description copied from interface: `LoginFormsProvider`
      Add a success message to the form
      Specified by:
        `addSuccess` in interface `LoginFormsProvider`
      Returns:

    - #### setSuccess

          public FreeMarkerLoginFormsProvider setSuccess(String message,
                                                         Object... parameters)

      Specified by:
        `setSuccess` in interface `LoginFormsProvider`

    - #### setInfo

          public FreeMarkerLoginFormsProvider setInfo(String message,
                                                      Object... parameters)

      Specified by:
        `setInfo` in interface `LoginFormsProvider`

    - #### setUser

          public FreeMarkerLoginFormsProvider setUser(UserModel user)

      Specified by:
        `setUser` in interface `LoginFormsProvider`

    - #### setFormData

          public FreeMarkerLoginFormsProvider setFormData(javax.ws.rs.core.MultivaluedMap<String,String> formData)

      Specified by:
        `setFormData` in interface `LoginFormsProvider`

    - #### setClientSessionCode

          public LoginFormsProvider setClientSessionCode(String accessCode)

      Specified by:
        `setClientSessionCode` in interface `LoginFormsProvider`

    - #### setClientSession

          public LoginFormsProvider setClientSession(ClientSessionModel clientSession)

      Specified by:
        `setClientSession` in interface `LoginFormsProvider`

    - #### setAccessRequest

          public LoginFormsProvider setAccessRequest(List<RoleModel> realmRolesRequested,
                                                     javax.ws.rs.core.MultivaluedMap<String,RoleModel> resourceRolesRequested,
                                                     List<ProtocolMapperModel> protocolMappersRequested)

      Specified by:
        `setAccessRequest` in interface `LoginFormsProvider`

    - #### setAccessRequest

          public LoginFormsProvider setAccessRequest(String accessRequestMessage)

      Specified by:
        `setAccessRequest` in interface `LoginFormsProvider`

    - #### setAttribute

          public LoginFormsProvider setAttribute(String name,
                                                 Object value)

      Specified by:
        `setAttribute` in interface `LoginFormsProvider`

    - #### setStatus

          public LoginFormsProvider setStatus(javax.ws.rs.core.Response.Status status)

      Specified by:
        `setStatus` in interface `LoginFormsProvider`

    - #### setActionUri

          public LoginFormsProvider setActionUri(URI actionUri)

      Specified by:
        `setActionUri` in interface `LoginFormsProvider`

    - #### setResponseHeader

          public LoginFormsProvider setResponseHeader(String headerName,
                                                      String headerValue)

      Specified by:
        `setResponseHeader` in interface `LoginFormsProvider`

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

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