Hope you are well.
I am wondering of someone could assist me or point me into a direction, perhaps someone has done this before but I have not gotten much info on it just yet.
I have a 3rd party system I wrote using .net. This system is has a link in the organizational online portal to it and on the feature class as well. Although I need to grab the user that has logged in via their online portal in .NET.
Any ideas how to access the token from the server side as the user lands in the 3rd party system? Using vb.net in the backend.
Also by grabbing the token, I see in JS it gives the user + role but like I said I need to grab it on the system load and store it perhaps somewhere?
Any ideas would be helpful
Here is how I pass JS Variable from JS to .Net code behind:
create a hidden field variable in the vb.net html code:
<asp:HiddenField ID="jsVariable" runat="server" />
then you can read the hidden variable field from the code behind using
dim variable as String = jsVariable.Value;
I do understand the code given above, to pass a JS variable over and store it in a hidden field to retrieve from the server side.
My question is however, if a user is logged in on the AGOL and uses the link provided in there to my system, how would I grab the person who is logged in username and the role assigned to him in his organization?
So let me see if I am following you... You have a JS app that the user clicks on a link and it takes then to an VB.Net app and you want to send the AGOL user info to that VB.Net app? If that is the case then url parameters in the link is the best solution.
So basically, a client of mine has their own ArcGIS online portal at ****.maps.arcgis.com.
I have added a link there to another system that I wrote using vb.net that I host on my own server.
The problem I am facing is that users in this organization has different roles, now depending on these roles coming from ArcGIS online they get to access certain parts in my system.
So what I need to do is, as soon as they use the link provided in their online portal I need to somehow grab the user that is logged in as well as the role assigned to him.
It comes down to linking my system which has nothing to do with ArcGIS online, to be able to get users + roles when landing on my home page.
My thoughts was that as soon as someone logs into their ArcGIS Online, it has to store the token somehow in the browser or somewhere for external systems to be able to get that type of info?
I hope this makes sense
Hmm... The fact that you do not have control of the code that the link exists in makes this complicated... Your right there has to be some record of the user info but that info would be encrypted and controlled by the originating Portal and I don't know of a way to gain access to it from just a link in the Portal.
The only possible way I thought to overcome this is maybe do it in a widget.
Basically I want to have a user click a feature on the map and then get the user that is logged in and its role assigned?
I have been playing around the identityManager but have not had much luck, is this the right route or is it possible to get the info through a widget when the user clicks the map?
thanks again for all your help and responses.
Thanks for this, will start exploring this option, as this would be my other option on how to integrate the 2 systems and know which user/role is currently on the map.
As always thanks a lot for the information.