NOTE: I am not interested in calling /secur/logout.jsp since it ends all the active salesforce sessions.
I am developing a web application that is registered on salesforce as a connected app, so I am using salesforce credentials to authorize the user.
Application is developed in REST API and the communication with salesforce is happening in restful manner.
Method 1: If there is no salesforce session active, The user is taken to salesforce login page, where he enters his salesforce details to be authorized and after which he is taken to home page of my web application.
Method 2: If there is already a salesforce session active in another tab, the user is directly authorized and is taken to home page of my web application.
Now I am trying to implement logout button for my application, such that the following scenarios are covered,
Scene 1: The user is authorized using method1, and the user press the logout. Upon trying to logback the user is prompted for credentials.
Scene 2: The user is authorized using method2, and the user should use logout to logout of the web application (not from active sessions). Upon login, the user should be again able to login using method2.
Can someone help me on how to implement the logout button such that it covers scenario 1 & 2.
Thanks in advance.