Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth issue on Azure Ad uiTest application automation. #1

Open
Imamitashish opened this issue Dec 7, 2021 · 3 comments
Open

Auth issue on Azure Ad uiTest application automation. #1

Imamitashish opened this issue Dec 7, 2021 · 3 comments

Comments

@Imamitashish
Copy link

Thank you for a wonderful code and process learning to use Azure AD and generating token to login to React applications. we are seeing a issue after we put the client id, secrets and other details where the part of the URL which does not match the actual URL generated. Can you help us with the error.

URL before we login to react app and authorization token is generated.

https://login.microsoftonline.com/tenant_id/oauth2/v2.0/authorize?client_id=client_id&scope=api_scope%2FRead%20openid%20profile%20offline_access&redirect_uri=https%3A%2F%2Fuiptest.fti-cloud.com&client-request-id=client-request-id&response_mode=fragment&response_type=code&x-client-SKU=msal.js.browser&x-client-VER=2.18.0&x-client-OS=&x-client-CPU=&client_info=1&code_challenge=gkLAk_UiZBzyt-0dA5xOtuWICklY4YAgLQuNgBNC8Cw**&**code_challenge_method=S256&nonce=dc8b80a3-8291-4206-b351-83c6bdea5b0c&state=eyJpZCI6ImFhNDFmMDZjLWNiY2ItNGQ3NC1iZDRjLWZkMGNmZGNhMDgwNCIsIm1ldGEiOnsiaW50ZXJhY3Rpb25UeXBlIjoicmVkaXJlY3QifX0%3D%7C%2Fportfolios%2Fsummary**&sso_reload=true

URL Generated from the code of Azure Ad uiTest Automation**

https://login.microsoftonline.com/tenant id/oauth2/v2.0/authorize?client_id=client_id&scope=api_scope%2FRead%20openid%20profile%20offline_access&redirect_uri=https%3A%2F%2Fuiptest.fti-cloud.com&client-request-id=client-request-id&response_mode=fragment&response_type=code&x-client-SKU=msal.js.browser&x-client-VER=2.18.0&x-client-OS=&x-client-CPU=&client_info=1&code_challenge=A74xunmr537AgM6e9H386STibM5uEc2p6GW67xfyLZk&code_**challenge_method=S256&nonce=979776b5-f362-48de-a004-a74467ab64df&state=eyJpZCI6ImExMjlhMzdiLTA3MDctNDBhMC05ZTE3LWE0OGM0ODg0NjNjNCIsIm1ldGEiOnsiaW50ZXJhY3Rpb25UeXBlIjoicmVkaXJlY3QifX0%3D&**sso_reload=true

Difference is from the challenge code, we are new to react and authorizations, can you help us with the resolution. Thank you for your support and time.

@malazo
Copy link

malazo commented Jun 9, 2022

HI, wonderfull job on the video explanation. I'm having a problem with the authentication. When i do the login everything works, but i get redirected to the microsoft ad portal to type the user and password. I think that this is not the expected behavior. Thanks a lot.

@juunas11
Copy link
Owner

There is a possibility that the storage format has changed in some way for MSAL.js and that would mean it does not correctly recognize the cached tokens injected by the tests. I won't have time to check this right now but at some point I will.

@malazo
Copy link

malazo commented Jun 11, 2022

HI @juunas11 . Thanks for your response. The problem was related with missing information that was saved in localstorage so msal does not recognize it because I was using and old tenant(created a long time ago when was in beta) and the information in the token was different. All the explanation is here:
https://stackoverflow.com/questions/72529561/cypress-azuread-login-always-redirects-outside-the-cypress-window/72576632#72576632 .
Thanks again for your quick response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants