http://[server]/hub-auth-js/
-
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 >
publiccommunity 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
}
);
- login to developers.arcgis.com
- use dashboard to create a new application
- generate a Proxy Service for Traffic
- add the proxied service to a public webmap
- copy webmap id into
config/applicationBase.json
"webMap": {
"default": "12a5ad74abb64a33a424e92741bff173",
- paste
Client ID
from your new application intoconfig/application.json
"oauthappid": "QVQNb3XfDzoboWS0",
- 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: