salesforce Auth. Provider and Auth0 Open Id connect Error - salesforce

I have setup an application in Auth0 (Open Id connect) and also an Auth. Provider in salesforce. Once the auth provider is created in salesforce it generated callback URL for main my-domain.my.salesforce.com as well as experience cloud sites.
I copied the callback URL in Auth0 redirect URI but still getting an error in salesforce when I am clicking the Auth0 button in experience cloud login UX in salesforce.
The saml-tracer is showing that the redirect URI is https://login.salesforce.com/services/authcallback/orgid/Auth0
Why is the redirect set to the above, for which I am getting an error while logging in. even though I updated it in Auth0 app in Auth0 by copying it from salesforce Auth. Provider.
However, when I am copying the sso URL from the Auth Provider that is redirecting me to Auth0 login prompt.
Any help is appreciated.

Related

Get authenticated user in AD using login_hint param and pass the data by Amplify to Cognito

I’m workin in a project with React JS that needs authenticate user from a redirect using a url with the “login_hint” param. There is a federation in AD and a Cognito User Pool with SAML configuration referenced to that federation domain. I can authenticate user normally with oAuth configuration and use Amplify Hub for listening data, but a I can’t found a solution to solve the authentication by redirect.
Example:
User login on Site A using federated AD account;
User click in a link to access the Site B, under same federation
URL to site B in site A href attribute is “https://www.siteb.net/?login_hint=user#domain.com
Site B reads URL and get “login_hint” value to request the user token or session to AD
Finally, the Amplify sends silent authentication to Cognito
So, it’s possible using Amplify, or combination of the Amplify and MSAL… or that is not possible this way?

Azure AD B2C user login redirect URI not recognized

I'm implementing a user login using Azure AD B2C. I've created an App Registration in my B2C tenant and added http://localhost:3000 as the redirect URI. Now I've also implemented it in my React app using the MSAL React library. For some weird reason I'm getting the error that the client using "xxx id" does not have http://localhost:3000 set as a redirect URI. This must be something stupid and small, but I'm just not seeing it.
This is the error I'm getting:
AADB2C90006: The redirect URI 'http://localhost:3000' provided in the request is not registered for the client id 'xxx'.
Now I'm using the provided client ID to search my Azure, I'm finding the App Registration, and I see the following:
So what am I missing here?
I guess I was impatient. Just took about ten minutes.

remix authentication with auth0 passwordless email link

I am using remix authenticator with the auth0 strategy to login users via redirect to auth0 email/password method.
Now i want to change it to work with auth0 passwordless email with link.
I am redirecting to the same callback route as before only to get an error: "missing state in url"
Any idea how to get this to work?

Cypress + API auth

I have a sample react app that uses an identity provider for user auth. I am trying to automate user login with cypress, via the IdP (Okta in this case) API.
With custom cypress command I am able to authorize and retrieve user details and authorization token, but I don't know what to do with that information.
After receiving user details and token if I come back to my app root (which is configured as the callback url), it just tells me I am not authenticated.
I have configured a /profile page that uses a Secure route in React, which should only be accessible when the user is logged in. If I get the token and then visit the /profile url, it still tells me I am not authenticated.
This blog post includes Cypress e2e with Keycloak, Okta, and Auth0. https://developer.okta.com/blog/2022/05/12/ionic-angular-jhipster
Code: https://github.com/oktadev/okta-jhipster-ionic-example/blob/main/ionic-app/cypress/support/commands.ts
JHipster does it a bit differently by leveraging the URLs that Spring Security creates and calling APIs directly. It doesn't do any authentication in Angular, React, or Vue because it's less secure than implementing it on the backend.
Code: https://github.com/jhipster/generator-jhipster/blob/main/generators/cypress/templates/src/test/javascript/cypress/support/oauth2.ts.ejs

Azure OAuth authentication from C# console application

I want to login into https://lcs.dynamics.com from a C# console application.
When you navigate to lcs.dynamics.com, it redirects to https://login.microsoftonline.com/common/oauth2/authorize
Here I enter a username as xyz#contoso.onmicrosoft.com and the password, system authenticates and redirects to lcs.dynamics.com
For this to work in my Azure Active Directory, I have created an Azure AD Web API application with the redirect URL as https://lcs.dynamics.com
I tried both approaches, creating a native application and authenticating using username and password as well as a Web API and authenticating using a secret key.
In both cases, I do receive an auth token which I parse as Bearer <auth_token> and set as the header value but when I make the HttpRequest, the response is still the login page instead of it moving ahead.
What am I doing wrong here?

Resources