No commit activity in last 3 years
No release in over 3 years
A gem for Autodesk 2-phase authentication service.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.1

Runtime

 Project Readme

adsk_auth_service

Gem Version

This is Ruby gem that is used to get second phase api token in Autodesk 2-phase authentication.

If you use Autodesk Development Portal, you must have Consumer Key and Consumer Secret.

In your application, there must be a directory called conf or config (either of them is good).
Modify the file conf/auth_keys.example.yml to create a file called conf/auth_keys.yml (or config/auth_keys.yml) and put your keys in there.

In the Gemfile of your application, write:

gem 'adsk_auth_service'

Then run bundle


Or you can build the gem locally:
``` git clone https://github.com/linhchauatl/adsk_auth_service.git

cd adsk_auth_service

gem build adsk_auth_service.gemspec

gem install adsk_auth_service-.gem


In your code:

require 'adsk_auth_service'


In order to get the authentication token, call:<br/>

AuthService.oauth_token

<br/>
Test from **irb**:<br/>
Inside **irb**, type the command `require 'adsk_auth_service'`<br/>
Then you can use `AuthService.oauth_token` within **irb**.<br/>

**AuthService.oauth_token** calls the API server all the time to get the token. Each token will be expired around 30 minutes - 1 hour.<br/>
You should consider about caching the token to reuse within expiration limit, instead of calling **AuthService.oauth_token** everytime when you need a token.<br/>