Authentication-mfa

Hi there,
I have authentication journey created at Forgerock openAM and using my react web app to call the journey do i need any sdk or can i call using forgerock api callbacks? Pls advice.
http://iam.mydmn.com:8090/am/json/authenticate?authIndexType=service&authIndexValue=AuthTreeTest

Did you have a look here Community | ForgeRock Backstage ?

Hi Sarris,
I didn’t find the answer am looking for in the link provided. Let me rephrase my ask,pls provide your approch.At forgerock openam I created an authentication journey which trigger MFA based up on GeoLocation .Well, then the client react will use oidc flow for this interaction then they interact with the journey steps through callbacks.So am not using any sdk for this bascially am not sure whether i should use it or not . However, I want to use my own login page hosted on react side and want to use below api to interact with forgerock based up on the answer received from openam will have callback response sent.Pls advice and let me know is there any guide to refer this flow or else just have couple of lines to top-up on this flow based on what i had.
stpe 1:
http://iam.mydmn.com:8090/am/json/authenticate?authIndexType=service&authIndexValue=AuthTreeTest ](http://iam.mydmn.com:8090/am/json/authenticate?authIndexType=service&authIndexValue=AuthTreeTest )
response: authId
2.sequentially will have clientsubmits based up on the forgerock ask during the transittion.

Thanks lot.

Hi @ysharat ,

You could indeed use ForgeRock’s SDK : What is Developer Experience? :: SDKs

The SDK supports both centralised and embedded login models, and the OIDC flow. And more.

Regards
Patrick

1 Like

Hi Patrick, Am getting below cors error in console.log, i had all the default configuration in web.xml since am using openAM verison 6.5.5. Essentially i think am getting this error Access-Control-Allow-Origin missing not sure where i would add this for the project embedded-login. pls advice. thanks

Below error in console.log
XHROPTIONS
https://iam12.example.com:8443/am655/json/realms/root/realms/testAdv/authenticate?authIndexType=service&authIndexValue=testAdvAuthTree
CORS Missing Allow Origin

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://iam12.example.com:8443/am655/json/realms/root/realms/testAdv/authenticate?authIndexType=service&authIndexValue=testAdvAuthTree. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 403.

XHRPOST
https://iam12.example.com:8443/am655/json/realms/root/realms/testAdv/authenticate?authIndexType=service&authIndexValue=testAdvAuthTree
NS_ERROR_DOM_BAD_URI

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://iam12.example.com:8443/am655/json/realms/root/realms/testAdv/authenticate?authIndexType=service&authIndexValue=testAdvAuthTree. (Reason: CORS request did not succeed). Status code: (null).

Fatal error TypeError: NetworkError when attempting to fetch resource.

Sounds like you need to enable CORS either at the FRAM or Ingress Level. Plenty of docs on Backstage to help you with that.

1 Like

Hi Nirving,
For now I can’t upgrade pls,Apparently am using sdk of Forgerock and followed the below link to spin up the sample of embedded-login.
https://backstage.forgerock.com/docs/sdks/latest/sdks/tutorials/javascript/index.html

In the example of embedded-login am getting below error like, No ‘Access-Control-Allow-Origin’ header is present on the requested resource. My ask was, where i would need to update the sample code to pass the Access-Control-Allow-Origin in the request? pls advice. thanks

Error:
https://iam12.example.com:8443/am655/json/realms/root/realms/testAdv/authenticate?authIndexType=service&authIndexValue=testAdvAuthTree’ from origin ‘https://yur.mydmn.com:8443’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

Did you enable CORS as per the link I sent you?

You need to do this in the ForgeRock Access Manager instance or at the ingress point i.e load balancer or web server of your FRAM instance.

1 Like