• Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login
FusionAuth
  • Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login

Using custom parameters with login page

Scheduled Pinned Locked Moved
General Discussion
0
3
2.2k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    maciej.wisniowski Power User
    last edited by 25 Feb 2021, 08:14

    Hi

    I have a use case where I'd like to customize the FA login page based on the parameters sent in the request. I mean that my application will add an extra parameter during redirect to the FusionAuth /oauth2/authorize URL. I know that I can access request parameters in the login page template (OAuth authorize) but as soon as a user tries to log in and an error occurs (eg. invalid password) all the request parameters are gone (page reload).

    So far I've found that I can use the user_code parameter (as I'm not using device flow) to achieve what I need. user_code is available all the time in the template, even after page reload, but is there any other option to do it? Some extra user_parameters would be great.

    1 Reply Last reply Reply Quote 0
    • M
      maciej.wisniowski Power User
      last edited by maciej.wisniowski 25 Feb 2021, 10:51

      Answering to myself. Seems I can do the following:

      [#if request.getParameter('custom_parameter')??]
                [#global custom_parameter = request.getParameter('custom_parameter')?string /]
                [@helpers.hidden name="custom_parameter" /]
      [/#if]
      </form>
      

      which just passes the parameter in the input field making it available after the form submit

      1 Reply Last reply Reply Quote 1
      • D
        dan
        last edited by 25 Feb 2021, 22:10

        @maciej-wisniowski said in Using custom parameters with login page:

        [@helpers.hidden name="custom_parameter" /]

        I did not know you could do that. Thanks for sharing your solution!

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        2 out of 3
        • First post
          2/3
          Last post