Esri / omniauth-arcgis

ArcGIS Online strategy for OmniAuth
https://rubygems.org/gems/omniauth-arcgis
Apache License 2.0
3 stars 3 forks source link

Rails example? #2

Open patrickarlt opened 9 years ago

patrickarlt commented 9 years ago

Would it be possible to make a basic Rails example of using this?

Maybe @ajturner or someone from DC could contribute it?

ajturner commented 9 years ago

I think @AKHarris @jwieringa @brooksjbr or myself could tackle this.

I also want to use it in the ArcGIS-ruby gem to replace token auth

jwieringa commented 9 years ago

@patrickarlt @ajturner I started an example in Rails; however, I ran into an invalid URI error which I believe is trying to tell me that the redirect_uri is not acceptable. I created a Sinatra app via the example and got the same error. Attempted to figure out via just HTTP calls, but I'm missing something.

Am I doing this right?

https://gist.github.com/jwieringa/9d5653aacb0f30a5e324

jwieringa commented 9 years ago

This is because Oauth must be on an arcgis.com domain. I'll revisit and update.

aaronpk commented 9 years ago

@jwieringa You just need to make sure you register the callback URL with the application you're making. It doesn't have to be an arcgis.com domain, you just have to explicitly add the redirect URI to your application on the developer site.

jwieringa commented 9 years ago

@aaronpk Got it thanks! Learning everyday, I'll post back with a Rails example.