These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Crest SSO and refresh tokens

First post
Author
NUBIARN
Brutal Ballerinas
#1 - 2016-03-02 21:11:36 UTC  |  Edited by: NUBIARN
so well it has been an interesting week with a steep learning curve, however I have now managed to get the SSO working from a windows 10 universal app all in c#. Lol

current status - can log in using the SSO gaining auth code => exchange auth code for access token => use access token to check logged in chars name id etc etc. actually pretty pleased with myself tbh.

next step - refresh the access token.

so here comes the question and explanation as to why I ask this. whilst setting up the app in the eve website I selected all scopes, as the app is currently just me playing with the functionality atm then no problem, so when I initially grab the original auth code if I set the scope item to coma separated list of selected scopes I think I will receive a refresh token as well as the auth code, currently not setting any scopes. so if I do this I should be able to not require my app to login again to the SSO just run refresh call if out of date. I think the above is correct just looking for verification so end protocol looks something like

1 - Log in and fetch auth code and refresh token [refresh token provided I set valid comma separated scopes]
2 - exchange auth code for access token
3 - verify char by submitting auth code
4 - use refresh token to get new access key whenever access token times out using the refresh token granted in step 1

I think the above is correct and potentially means if I didn't want to verify user I could skip parts 2 and 3, so is the above correct?

many thanks and sorry for the convoluted waffle.
nubs
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#2 - 2016-03-02 21:38:33 UTC
NUBIARN wrote:
so well it has been an interesting week with a steep learning curve, however I have now managed to get the SSO working from a windows 10 universal app all in c#. Lol

current status - can log in using the SSO gaining auth code => exchange auth code for access token => use access token to check logged in chars name id etc etc. actually pretty pleased with myself tbh.

next step - refresh the access token.

so here comes the question and explanation as to why I ask this. whilst setting up the app in the eve website I selected all scopes, as the app is currently just me playing with the functionality atm then no problem, so when I initially grab the original auth code if I set the scope item to coma separated list of selected scopes I think I will receive a refresh token as well as the auth code, currently not setting any scopes. so if I do this I should be able to not require my app to login again to the SSO just run refresh call if out of date. I think the above is correct just looking for verification so end protocol looks something like

1 - Log in and fetch auth code and refresh token [refresh token provided I set valid comma separated scopes]
2 - exchange auth code for access token
3 - verify char by submitting auth code
4 - use refresh token to get new access key whenever access token times out using the refresh token granted in step 1

I think the above is correct and potentially means if I didn't want to verify user I could skip parts 2 and 3, so is the above correct?

many thanks and sorry for the convoluted waffle.
nubs



Step 2 is a required one. Because if you don't do it, I could 'log in' without actually checking the username and password. I just go straight to the app and hand it a dud code.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Ortho Loess
Escalated.
OnlyFleets.
#3 - 2016-03-02 21:46:38 UTC  |  Edited by: Ortho Loess
Two minor corrections:

1. Scopes are sent as a space delimited string (don't ask me why!)
see https://eveonline-third-party-documentation.readthedocs.org/en/latest/sso/authentication/

2. The refresh token comes back with the access token, so in step 2, not step 1.
NUBIARN
Brutal Ballerinas
#4 - 2016-03-02 21:52:43 UTC
thank you very much for replies that clears up my questions nicely. seems like I can`t read properly !!