Passing in parameters when logging in

I want to be able to pass in a variable of my own creation (an arbitrary string, for example “hello world”) into the login URL of my app, so that I can retrieve it out of the URL once I am logged in. I want to do this so I can associate a custom-generated “session key” with a user’s access token, which will allow my app to search the database using that session key and retrieve the correct access token from the server. This is a followup to a post I made earlier, and a concept for how I can retrieve an access token in another standalone app.

Hi @btarg

An option that you have is to pass in your parameter into your /authorize request as below:

https://YOUR_DOMAIN/authorize?
response_type=code&
client_id=YOUR_CLIENT_ID&
redirect_uri=https://YOUR_APP/callback&
myparam=helloword

This will then be available in rules via context.request.query.myparam

As you can pick this up in rules, this also means that you can then add the value to the id token and then pick it up in the session in your application or add it to user_metadata and pick it up from there etc.

I hope this helps
Warm regards.