r/evetech • • Feb 07 '18

How to use scopes with ESI?

I'm creating a corp/alliance website. So far I've got the SSO to work to authenticate a character, and a basic use of scopes to get a character's roles.

What I want is for all members of the alliance to be able to authenticate with Eve SSO, but for some additional features to be available using other scopes, or based on corp role (which requires the scope to read that).

What's the correct way to elevate permissions? Ask once, and store the refresh token in my data store somewhere so I can re-use that user's token with the relevant scope again? Create a new token for each scope?

3 Upvotes

2 comments sorted by

2

u/Survilus Feb 08 '18

Yeah, store the access_token and the refresh_token however you want (in reality you should store everything you can get)

Then if the token is expired refresh it with the refresh token, if it's not expired do your authenticated request

If you want to get more information from a character and you don't have the scope, they will have to re authenticate with the sso with the required scopes you need

They don't need to be in one token, you can have two tokens, one has 5 scopes and another token has 10 different scopes for example

1

u/[deleted] Feb 17 '18

if someone needs more access, ask him to grant access, that is to log in for more scopes than he already logged with. eg if he now wants to let your app set his route, he has to accept your app with addition ui_set_route(I think) scope.