How to implement app login ?

1310
8
Jump to solution
03-20-2020 08:22 AM
PratikAdyalkar
New Contributor

Hi,

I want to implement app login for a closed group of people who are not AGOL user. Can anyone give me general step-wise process to achieve this?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ErwinSoekianto
Esri Regular Contributor

Hello Pratik, 

I am sharing a simple app to show you how the login and user registration workflow in an AppStudio app, reading and writing SQLite database to save user information, see attached for source code. This is based on this blog post and then converted into AppStudio apps. 

Also, we have another sample that shows you how to handle social media login, for example Google and Facebook logins, see attached for source code. 

Apart from having the source code of the above two apps attached in this post, they are also shared publicly and available to be tested in AppStudio Player by searching in Public apps. 

 

And lastly, we also have a lot of individual samples such as SQL, Secure Storage and Biometric Authentication available in AppStudio Desktop and Player that you can use to enhance the login experience. 

I hope this is useful,

Erwin. 

View solution in original post

8 Replies
ErwinSoekianto
Esri Regular Contributor

Hello Pratik, 

I am sharing a simple app to show you how the login and user registration workflow in an AppStudio app, reading and writing SQLite database to save user information, see attached for source code. This is based on this blog post and then converted into AppStudio apps. 

Also, we have another sample that shows you how to handle social media login, for example Google and Facebook logins, see attached for source code. 

Apart from having the source code of the above two apps attached in this post, they are also shared publicly and available to be tested in AppStudio Player by searching in Public apps. 

 

And lastly, we also have a lot of individual samples such as SQL, Secure Storage and Biometric Authentication available in AppStudio Desktop and Player that you can use to enhance the login experience. 

I hope this is useful,

Erwin. 

PratikAdyalkar
New Contributor

Thanks Erwin but how do i get access to AGOL maps using these samples?

The maps are supposed to stay private and only available to employees.

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Based on the license agreement, if your data (maps) are not public, you need to login using named-users. We have OAuth Biometric Authentication and Portal User Info samples that show you how to OAuth login workflow and accessing the user info and a private map in ArcGIS Online.

Quoting from this doc, Limitations of App Login | ArcGIS for Developers 

Although you cannot use an AppID with private content, if your goal is to distribute or sell an app to organizations without ArcGIS Online (no named users), it is not against the license agreement to use your own login to the app, given that the content has been shared publicly.
0 Kudos
MarkC1
by
Occasional Contributor

Erwin Soekianto, can I ask what is the point of implementing a login/user registration system like in your example above if the maps/data behind it need to be publicly shared anyway? What good is having your own login system if the data is public and the login system can therefore be bypassed.

Maybe I misunderstand something but this seems really counter intuitive and contradictory to me.

ErwinSoekianto
Esri Regular Contributor

Mark,

There are times when you want to handle and maintain your own login/user registration system in your own database, and display public maps from ArcGIS. This scenario is often used when there are other user-related functionalities that are not covered in ArcGIS, when maps or GIS is not the main functionality of the application. 

I hope this clarifies things. 

Erwin.

0 Kudos
NilsBabel1
Occasional Contributor

Hello, I'm attempting to implement App Logins as well, for a web application using the ArcGIS JavaScript API.  I have read all of the documentation around this and still do not understand how to do this and now I'm confused.  Are you saying that you can't give access to secured features in ArcGIS Online?  I have some layers I want to access that are shared with a group in the organization.  I've read this documentation on App Logins:  Access secure resources | ArcGIS API for JavaScript 4.16 and tried to follow this methodology.  I have registered my app and have a Client ID and secret but I'm unsure how to use them to get a token to access the layers.  Can you explain the documentation I've listed, given your comment that you aren't allowed to access secure resources?  

Thanks so much.

0 Kudos
ErwinSoekianto
Esri Regular Contributor

I am going to include ArcGIS API for JavaScript‌ group to help with this question. 

0 Kudos
MohdNuruddinAbdulKadir
New Contributor

Hello ErwinSoekinto, thanks for sharing, but how can I track the database that keep the data when the user register?

0 Kudos