Signout portal from web app builder app

1332
8
Jump to solution
09-14-2017 12:04 AM
Highlighted
Occasional Contributor II

Has anyone implemented a logout system for the ArcGIS Portal credentials in their web app builder app? 

 

1 Solution

Accepted Solutions
Highlighted
New Contributor III

As @akshay loya stated above, https://www.ascentdatamanager.com/arcgis/sharing/rest/oauth2/signoutwill sign the user out while showing a signout confirmation page at the same time. 

In order not to display the signout conformation page, use the following code inside the Signout event:

var oReq = new XMLHttpRequest();
oReq.open("get", "https://www.ascentdatamanager.com/arcgis/sharing/rest/oauth2/signout", false);
oReq.setRequestHeader('Content-Type', 'text/xml');// this is required for Google Chrome
oReq.send();

Reference: javascript - Calling client side URL from browser without opening new page - Stack Overflow  

This is just a nice workaound. Why the sign out function in the web appbuilder does not work, don't know yet.

View solution in original post

8 Replies
Highlighted
MVP Esteemed Contributor

Akshay,


   I have never thought that there is a need for that. What is you reasoning for wanting it?

Reply
0 Kudos
Highlighted
Occasional Contributor II

Well. I have multiple application running on portal which I've customized using the web app builder and they're using portal credential to login. We create groups on portal depending upon the project need and share the maps with them. There is possibility of multiple users using the application on a system. In that case I would want my user to logout from application itself(Who is obviously not aware of portal).

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Akshay,

What theme are you using? If you are using a theme that has the HeaderController widget then you can programatically call the Header Controller Widgets _onSignoutClick function to sign out. If not then you can look at that code to see that you can use the tokenUtils call and call tokenUtils.signOutAll method.

Reply
0 Kudos
Highlighted
Occasional Contributor II

I tried this but seems to be not working for me then I had to use this link instead 

https://www.ascentdatamanager.com/arcgis/sharing/rest/oauth2/signout 

which takes me to other page, which is bit annoying.

Reply
0 Kudos
Highlighted
New Contributor III

Has anybody got it worked? I am having the same issue. The sign out function in the web appbuilder cannot sign out the user, as after the signout function (widget) is executed, in the web browser when navigating to the Portal page, the user is still signed in!

Highlighted
New Contributor III

As @akshay loya stated above, https://www.ascentdatamanager.com/arcgis/sharing/rest/oauth2/signoutwill sign the user out while showing a signout confirmation page at the same time. 

In order not to display the signout conformation page, use the following code inside the Signout event:

var oReq = new XMLHttpRequest();
oReq.open("get", "https://www.ascentdatamanager.com/arcgis/sharing/rest/oauth2/signout", false);
oReq.setRequestHeader('Content-Type', 'text/xml');// this is required for Google Chrome
oReq.send();

Reference: javascript - Calling client side URL from browser without opening new page - Stack Overflow  

This is just a nice workaound. Why the sign out function in the web appbuilder does not work, don't know yet.

View solution in original post

Highlighted
New Contributor III

I found a really good workaround.

Add a link, title it "logout" and link to https://arcgis.com/home/pages/Account/manage_accounts.html#client_id=arcgisonline&signout=true 

Highlighted
Occasional Contributor II

Is there a similar workaround for loging a user out of a AGOL hosted Web application Builder App?

Reply
0 Kudos