96
Views
3
Comments
Solved
[OIDC Client] OIDC setup issues with redirects
oidc-client
Reactive icon
Forge asset by João Barata
Application Type
Reactive
Service Studio Version
11.54.36 (Build 62983)
Platform Version
11.23.1 (Build 41677)

I'm new to this, so bare with me!

I'm setting up B2C authentication using Forge component 'OIDC Client'. I modified my app as per OIDC documentation, but have a couple of doubts:

  1. OnException: There is an 'Assign' in the screenshot but I cant find the details of this step.
  2. For the logout flow I find four client actions in the block. Where do I use the 'Get_Logout_URL'?

When I try to login to my app I'm directed to my B2C and I'm able to login, but I'm not redirected to my app.

Thank you in advance for your help!

2023-04-03 21-05-20
Shahin Keshavari
Solution

Hi Joao,

To answer your 2nd question:  For the logout flow I find four client actions in the block. Where do I use the 'Get_Logout_URL'?

  • When your user clicks on the logout url, you have to do 2 things:
    • log the user out in OutSystems. For this you can just use the logout action from the (System) dependency.
    • log the user out at your identity provider. The 'Get_Logout_URL' gives you the URL for your identity provider that you can redirect the user to so they can logout there too.
  • So something like this:



To answer your last question: When I try to login to my app I'm directed to my B2C and I'm able to login, but I'm not redirected to my app.

  • When you use the action Get_Authorization_URL in your application, make sure that you also provide the OriginalURL. This is the URL that the user will be redirected to after a successful login. 



2023-04-03 21-05-20
Shahin Keshavari
Solution

I had to dig in a little to find out what you meant by your first question. I think you mean this screenshot in the documentation right?


The assign there you can ignore, it was used to set some client variables before sending the user to a different link. It is often something like this below, the client.LastURL is sometimes used to steer the flow, I do not assume you need it here for OIDC to work


2023-04-03 21-05-20
Shahin Keshavari
Solution

Hi Joao,

To answer your 2nd question:  For the logout flow I find four client actions in the block. Where do I use the 'Get_Logout_URL'?

  • When your user clicks on the logout url, you have to do 2 things:
    • log the user out in OutSystems. For this you can just use the logout action from the (System) dependency.
    • log the user out at your identity provider. The 'Get_Logout_URL' gives you the URL for your identity provider that you can redirect the user to so they can logout there too.
  • So something like this:



To answer your last question: When I try to login to my app I'm directed to my B2C and I'm able to login, but I'm not redirected to my app.

  • When you use the action Get_Authorization_URL in your application, make sure that you also provide the OriginalURL. This is the URL that the user will be redirected to after a successful login. 



2023-04-03 21-05-20
Shahin Keshavari
Solution

I had to dig in a little to find out what you meant by your first question. I think you mean this screenshot in the documentation right?


The assign there you can ignore, it was used to set some client variables before sending the user to a different link. It is often something like this below, the client.LastURL is sometimes used to steer the flow, I do not assume you need it here for OIDC to work


2024-05-13 14-48-32
João Pedro Oliveira

Thank you Shahin. I made some progress. I have a few issues that I believe are related to how B2C is setup but your answers helped solve de doubts I had.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.