-
Notifications
You must be signed in to change notification settings - Fork 442
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
The issue with the "logout" function is that the popup window that opens does not close. #1042
Comments
See the following issue for help in resolving this. Azure AD requires a very specific setup in your azure AD account and RN application in order for logout redirect to work properly. |
Hello carbonrobot, I've already followed all the necessary steps. Just to be sure, I executed these commands and the application opens correctly, so I don't think the issue is related to the deeplink.
The main issue arises in the
Thank you. |
You might try configuring your - postLogoutRedirectUrl: 'tr.edu.ozyegin.myozutest://oauth/logged_out/',
+ postLogoutRedirectUrl: 'https://my.ozyegin.edu.tr/.oauth/logged_out', |
Duplicate of #916, but I will move the discussion here since that issue is much older. |
I discovered that the issue was due to adding the iosPrefersEphemeralSession parameter. I included this parameter to avoid the alert message 'XXX Wants to Use "microsoftonline.com" to Sign In.' Yes, I tested it by removing the iosPrefersEphemeralSession parameter, and it worked! When we use the iosPrefersEphemeralSession parameter, it doesn't redirect with the postLogoutRedirectUrl in Azure AD. I'm not sure whether the issue is related to Azure AD or the react-native-app-auth module. without.mp4 |
There is no problem on Android. If others face issues on Android, I am sharing some code:
|
If you don't want to use the
authorize({
issuer: 'https://login.microsoftonline.com/[TENANT_ID]/v2.0',
clientId: 'CLIENT_ID',
redirectUrl: 'com.myapp://oauth/redirect',
scopes: ['openid', 'profile', 'email'],
});
logout(
{
issuer: 'https://login.microsoftonline.com/[TENANT_ID]/v2.0',
},
{
idToken,
postLogoutRedirectUrl: 'https://DOMAIN/.oauth/logout',
}
); I hope the code I shared above for iOS and Android has been helpful without using the |
Here is an explanation from Microsoft Engineering: Because of this, using the iosPrefersEphemeralSession parameter means we don't need a logout function. This is demonstrated in one of Microsoft's examples, "msgraph-sample-react-native," which uses the iosPrefersEphemeralSession parameter. In this code, there is no logout function. Instead, it's sufficient to delete the stored token information and redirect to the login screen. |
Good info, I will try to capture this in the documentation in some way. |
Issue
Hello,
The callback URIs are defined in the Azure AD portal.
tr.edu.ozyegin.myozutest://oauth/redirect/
tr.edu.ozyegin.myozutest://oauth/logged_out/
For login:
When you run the following code, it opens a login window where, after entering the email and password, the automatically opened window closes successfully. There is no problem with the authorize function.
However, when logging out, the window that opens does not automatically close. There is a problem with this:
I am sharing the video as attached.
out.mp4
What should I do?
Environment
Azure AD
both
react-native
Version:e.g. 0.75.4
react-native-app-auth
Version:e.g. 8.0.1
The text was updated successfully, but these errors were encountered: