React-native-app-auth: How to do logout action in SalesForce ?

Created on 23 Oct 2018  路  10Comments  路  Source: FormidableLabs/react-native-app-auth

Current implementation

  1. Have salesforce as idp
  2. Do login all good
  3. Then i want to do logout but to do logout in salesforce i need to open browser on link https://my.salesforce.com/services/auth/idp/oidc/logout and close once its done

could you help me find proper way to do it ?

Most helpful comment

If you add

additionalParameters: {
  prompt: 'login'
}

to your config, it should always prompt the user to log in.

All 10 comments

I'm not really sure. Is it necessarily a browser window? You could try Linking.openUrl() and see if that works?

i have tried it but seems like it opens some other browser instance without salesforce cookies

"Single sign out" is not part of the spec. When the user asks to "sign out" you can just call revoke() which revokes the passed in token. Then delete and saved tokens from your app and take the user back to the "sign in" page.

I am doing revoke
but strange case is that when i am do login once again i dont see login form seems like its cookie

If you add

additionalParameters: {
  prompt: 'login'
}

to your config, it should always prompt the user to log in.

Thanks it works

"Single sign out" is not part of the spec. When the user asks to "sign out" you can just call revoke() which revokes the passed in token. Then delete and saved tokens from your app and take the user back to the "sign in" page.

After following the steps to logout (revoke and deleted all tokens), whenever user tries to log back in he is redirected to Okta login form to verify password. What I need is the form to enter both username and password.

There is a signout button which allows to enter the username password but after login the user is redirected to okta app instead of mobile application.

simulator screen shot - iphone 8 plus - 2018-12-26 at 16 22 25

@laxmankhanal even using

additionalParameters: {
  prompt: 'login'
}

?

Thanks it works

If you add

additionalParameters: {
  prompt: 'login'
}

to your config, it should always prompt the user to log in.

Doesn't work with cognito config :(

I have the same issue with Amazon Cognito. Even with additionalParameters, the login page does not appear.

@wdevon99 Did you find a solution?

Solution: Actually, I found a workaround. You could replace the authorizationEndpoint in the config as follows:

  • From https://<domain_name>.auth.eu-central-1.amazoncognito.com/oauth2/login
  • To https://<domain_name>.auth.eu-central-1.amazoncognito.com/login, while keeping everything constant.

Then, the user will have the possibility to continue as... or to sign out before login.

Screenshot 2019-06-02 at 19 59 38

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jarzka picture Jarzka  路  4Comments

djleonskennedy picture djleonskennedy  路  3Comments

erichulser picture erichulser  路  5Comments

jevakallio picture jevakallio  路  5Comments

titoff002 picture titoff002  路  7Comments