Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ session.create_access_token('the_access_token_returned')

The client initialized, we can start interacting with the Egnyte API.

Note:
You can add a parameters to authorize_url,
Ex. To limit access only for the filesystem, add a :scope option to authorize_url
```
session.authorize_url('https://127.0.0.1/oauth2callback', scope: "Egnyte.filesystem")
```

Folders
------

Expand Down
5 changes: 3 additions & 2 deletions lib/egnyte/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ def initialize(opts, strategy=:implicit, backoff=0.5)
@access_token = OAuth2::AccessToken.new(@client, opts[:access_token]) if opts[:access_token]
end

def authorize_url(redirect_uri)
@client.implicit.authorize_url(:redirect_uri => redirect_uri)
def authorize_url(redirect_uri, params ={})
params.merge!(:redirect_uri => redirect_uri)
@client.implicit.authorize_url(params)
end

def create_access_token(token)
Expand Down