Fork me on GitHub

Start Building Your App

Patrick Arlt

Experience Developer - Esri Portland R&D Center

@patrickarlt - http://bit.ly/1cnAUEr

A bit of background...

  • I joined Esri in mid 2012 (From the Geoloqi acquisition)
  • There was no developer site for ArcGIS
  • ArcGIS for Developers launched at Dev Summit 2013

Since Then...

  • Most docs are moving/moved to developers.arcgis.com
  • New tools for developers
  • Lots of new capabilites
  • Lots of new use cases

Lets Build An App

  • Application
  • Users
  • OAuth 2
Most reactions to OAuth

Lets face it Oauth 2 is…

  • Scary
  • Awesome
  • The future
  • All of the above

A more technical overview of Oauth 2…

Using ArcGIS with OAuth 2.0

Aaron Parecki @ Middle East Dev Summit

Before OAuth 2…

thanks for your password

Now…

oauth login

OAuth 2 is great becuse…

  • Users don't have to give away their passwords
  • You dont have to store users passwords
  • Standardized central & authorative login system
  • A well accepted standard around the web

Questions and Decisions

  • Do my users have ArcGIS Online accounts?
  • Do I want my users to login w/ their ArcGIS Online accounts?
  • What is my users don't have ArcGIS Online accounts?

A Tale Of Two Use Cases

"App Logins" vs "User Logins"

"User Logins"

Users allow your applcation to access their ArcGIS Online content an use services on their behalf.

  • Users will login with their ArcGIS Online accounts
  • Your app will get an access_token
  • Use access_token to access that users content
  • Use the access_token to access services like directions, geocoding, GeoEnrichment, ect...

"User Logins" great for

  • Building apps for the ArcGIS Marketplace
  • Extending ArcGIS Online
  • Letting ArcGIS Online users access premium services

"App Logins"

Your application uses services on behalf of users.

  • Your app gets an access_token from ArcGIS Online
  • Use the access_token to access premium services like directions, geocoding, GeoEnrichment, ect…
  • You will be able to read from services owned by the same account as the application

"App Logins" great For

  • Allowing users to use ArcGIS Online services without authentication
  • Letting your own authenticated users access ArcGIS services
  • Server and script based applications

Demo Apps

  1. Vanilla JS user login
  2. JS API user login
  3. App login on the server
  4. App login with a proxy

Vanilla JS user login

OAuth 2 with no frameworks or servers.

Source on GitHub

JS API user login

Integrate OAuth 2 authentication into the JS API.

Source on GitHub

App login on the server

Have our server make authenticated calls to ArcGIS Online.

Source on GitHub

App login with a proxy

Use a proxy with the JS API so make authenticated calls without logging in.

Source on GitHub

Thanks

Twitter : @patrickarlt

Slides : http://bit.ly/1cnAUEr


Esri