•   about 5 years ago

Oauth Example for those using Ruby/Rails

Hey all, I was struggling to get Oauth setup in a Rails backend as there are only examples for Node.js and Python/Flask. It's actually quite simple once you have it up and running. To get authentication set up, run through these short tasks:

1. Head to your apps and set up both Scopes and your Redirect URI: https://genomelink.io/developers/apps/

2. In your application frontend html, add a link like this: https://genomelink.io/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT&scope=report:eye-color

In that link, update YOUR_CLIENT_ID with your client ID and YOUR_REDIRECT with whatever redirect you like (mine is http://localhost:3000/callback). Lastly, the scopes can be set to whatever you want, I used report:eye-color for simplicity.

3. You'll be returned a token when you go through the flow in-browser.

If anyone is struggling with a Rails backend I would be happy to help.


  • 1 comment

  • Manager   •   about 5 years ago

    Thanks Bryan!

Comments are closed.