You need to sign in to do that
Don't have an account?
Igor Androsov 22
How to pass custom parameters to Login page controller via OAuth services/oauth2/authorize
I am using Community as Identity for my Heroku app via OAuth Web Server flow. Standard login works ok.
Now I need to pass a custom parameter to my controller during this Login flow and do not see a way to do this. I try to use URL params but that get removed during redirect of OAuth dance/flow.
My community page is passing parameter if I hit that URL directly. But if I use community URL it does not get this parameter. That seems to be restricted set what can be passed to OAuth as documented here: https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com
But I want to know if it is possible, anyone has done it to pass any custom parameter from initial request to Controller?
In My example, I need to add parameter <URL>?poi=999 to my OAuth request and get this value in my Login controller.
My current URL format that does not work: https://<COMMUNITY HOST>/services/oauth2/authorize?response_type=code&poi=999&client_id=<MY LONG CLIENT ID>&redirect_uri=http://localhost:8080/authorized&prompt=login consent&display=page
Now I need to pass a custom parameter to my controller during this Login flow and do not see a way to do this. I try to use URL params but that get removed during redirect of OAuth dance/flow.
My community page is passing parameter if I hit that URL directly. But if I use community URL it does not get this parameter. That seems to be restricted set what can be passed to OAuth as documented here: https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com
But I want to know if it is possible, anyone has done it to pass any custom parameter from initial request to Controller?
In My example, I need to add parameter <URL>?poi=999 to my OAuth request and get this value in my Login controller.
My current URL format that does not work: https://<COMMUNITY HOST>/services/oauth2/authorize?response_type=code&poi=999&client_id=<MY LONG CLIENT ID>&redirect_uri=http://localhost:8080/authorized&prompt=login consent&display=page
have you found a solution? I'm in the same situation now :). I need to pass a value to the url, but seems doesn't mantain the value, instead i have only startURL parameter
@GetMapping("/login") public ModelAndView showCustomLoginForm(@Valid @RequestParam(value = "realm_name", required=false) final String realmName) { CustomLoginForm form = new CustomLoginForm(realmName); return new ModelAndView(CUSTOM_LOGIN_FORM_VIEW, CUSTOM_LOGIN_FORM_MODEL, form); }