Skip to content

Latest commit

 

History

History
 
 

hub-auth-ts

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Hub Auth App Example

http://[server]/hub-auth-ts/

  • no sign-in required > loads public webmap

  • display premium content that requires an account

includes proxied premium service

  • support optional sign-in > oauth 2.0 login

  • social media account > public community account

var info = new OAuthInfo({
    portalUrl: config.communityPortalUrl
});
  • get reference to token after users sign in
esriId.checkSignInStatus(info.portalUrl + "/sharing").then(
    function(credential) {
      credential.token
    }
);

Requirements

  1. login to developers.arcgis.com
  2. use dashboard to create a new application
  3. generate a Proxy Service for Traffic
  4. add the proxied service to a public webmap
  5. copy webmap id into config/applicationBase.json
"webMap": {
    "default": "12a5ad74abb64a33a424e92741bff173",
  1. paste Client ID from your new application into config/application.json
"oauthappid": "QVQNb3XfDzoboWS0",
  1. add enterprise org url to config/application.json
"portalUrl": "https://edn.maps.arcgis.com",

this is used internally to identify the associated community org. another option is to supply it directly.

"communityPortalUrl": "https://civic.maps.arcgis.com",

reference: