Dynamic parameter to onelogin service - onelogin

I am new to onelogin service.
I want to know any possibilities to pass a dynamic parameter value to relay state URL in onelogin.
This is my current situation.
User tries to login to "sampleproduct.com"
"sampleproduct.com" redirects to onelogin console (no parameters are passed from "sampleproduct.com")
User logs in to portal
Then user click on the application configured in the onelogin service
After clicking the application a call back will reach at "sampleproduct.com"
This is what I am looking for.
User tries to log in to "sampleproduct.com"
"sampleproduct.com" redirects to onelogin console with a parameter with value [like subdomain.onelogin.com?dateVal=5844588]
After succesfully logging in to onelogin, a callback will reach "sampleproduct.com" with "dateVal=5844588"
Please note "dateVal" parameter value will change. That means the value of the "dateVal" parameter is dynamic and this parameter is passed from "sampleproduct.com"

Related

How to edit reply URL in Azure B2C user flow

I want to edit the reply URL in my user flow. How can I do this? This is a reset password user-flow. Is this even possible or do I have to create a new user flow from scratch?
You can't edit it.
But what you can do is have lots of reply URL in the app. and then pick from the dropdown.
Those URLs are tied to the Application Registrations, each app registration can have multiple return URLs (as you're showing in your screenshot).
If you want to add another URL to that list you need to add it to the app registration for your LoginAppAndWeb application. The Microsoft Docs explain how to add an app registration, you likely just need to find the existing one for your app and update it.
It's down to the relying party (your actual LoginAppAndWeb app) to pass up the correct return URL as part of it's /authorize request, B2C will then redirect to that URL at the end of the journey provided it's in the list you've set up in the app registration.
Often, relying parties will have a single return URL so there's a single point B2C redirects to that processes the B2C tokens, then they'll have a separate way of redirecting the user on to another internal URL afterwards. That could be something that's passed as part of the state parameter or it could be something that's stored by the browser (e.g. in a cookie), the client library you're using to interact with B2C will likely have a standard way of doing this.

B2C Redirect to specified URI after Login

We are using b2c for our identity management. We have a destination link that only authorized users can see. Let's call this https://www.hypertrends.com/my-destination
When they arrive at this page, if they are unauthorized, then they get redirected to the B2C Login. This works perfectly fine. However, after login, we would like to send them back to the original page (i.e. my-destination) they first landed on.
We can't seem to figure out how to get that done. Does anyone have an idea on how this can be implemented in B2C?
Use the authentication library to pass in a value for the “state” parameter. This parameter will be returned in the authentication response to your application.
Encode a value which represents the location of where the user was on the website, and put it in the “state” parameter.
After the user logs in, have the application parse the state parameter and send the user to the correct location.
https://learn.microsoft.com/en-us/azure/active-directory-b2c/openid-connect#send-authentication-requests

App Services Web App SSO integration and Get Email Name before redirect URL

I Deployed my node.js application to Azure App Service, By using Authentication i Enabled Azure Active Directory in App Service app(https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad).
My application will now use the Azure directory login and successfully redirects to the (mydoman.azurewebsites.net). The default redirect URI is confiured as /.auth/login/aad/callback.
Everyhting Work fine till here. But the next thing is I want to get emailID of the logged User and do the action my application. I dont know form redirection URL how can i get the email ID to use in my application
I m attaching the webbrowser console in netwrok tab. In between callback service and dashboard i want top ass email and render dashboard with user data on my application.
For the callback redirect /.auth/login/aad/callback. URI , I m getting code and access Token also.
Generally, the email ID you mean is also the user principal name of the logged user.
So if you want to get it, you just need to access the X-MS-CLIENT-PRINCIPAL-NAME request header.
For more details, see Access user claims.

OneLogin redirect to an external link upon successful authentication

I have OneLogin set up for SAML authentication for my application. A functionality of my application sends out notification links to users to take certain surveys. When a user clicks on the link it takes the user to the OneLogin page for authentication. Upon successful authentication the user is redirected to the default page of the application and not the survey page which the user is supposed to work on.
Current OneLogin setup has the Consumer URL set to the default.aspx page of my application. In the web.config I have added the One Login end point connector information.
Can anything be done in the OneLogin setup to cater to the above need? Or do we need to deal with this at the application level itself. Can we set up Rules in the RULES section of my application setup in OneLogin?
To have this work properly you it sounds like you need to implement the relay state for SAML.
Essentially this value can function as a "deep link" within your application rather than the simple default page you have now.
This is usually implemented as part of SP-initiated SAML with a flow as follows
Send the user to your application - to the survey URL you want
Application doesn't have a session, starts an SP-initiated SAML flow to the provider (OneLogin) with a relay state set.
User authenticates, OneLogin does a SAML flow back to the app with the originally passed in Relay state.
Your app handles the SAML login and uses the relay state to direct the user to the original 'deep link' / relay state page.

Foursquare authentication, passing a custom parameter

Is there any way to pass a custom parameter to Foursquare that it will pass back in it's response?
In Facebook you can pass custom parameters using the state parameter:
https://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID
&redirect_uri=YOUR_REDIRECT_URI
&scope=COMMA_SEPARATED_LIST_OF_PERMISSION_NAMES
&state=SOME_ARBITRARY_BUT_UNIQUE_STRING
The state parameter should be set to some arbitrary string you generate uniquely for each authentication request. This value will be passed back as a parameter to your redirect_uri once the user has authorized your app and you should check that the returned value matched the value you passed in at the start of the flow. This guards against Cross-site Request Forgery by ensuring the incoming redirect is part of the authentication flow which you initiated.
Google also has the state parameter:
state
any string
Indicates any state which may be useful to your application upon receipt of the response. The Google Authorization Server roundtrips this parameter, so your application receives the same value it sent. Possible uses include redirecting the user to the correct resource in your site, nonces, and cross-site-request-forgery mitigations.
It would be extremely helpful to have this using Foursquare as well.
You can specify additional URL parameters in your redirect_uri that are not part of the registered callback URL and they will be passed through upon successful authorization.

Resources