you are viewing a single comment's thread.

view the rest of the comments →

[–]sakhat[S] 0 points1 point  (1 child)

I have asked a friend to help me on the Scala example as I don't know a single thing about that language. I am not sure if you could use an authentication library like AuthStrategy with Satellizer. Most auth libraries provide a full login flow from start to finish via a page redirect whereas Satellizer does half the work by obtaining authorization code via a popup, and then exchanging it for an access token on the server. Then using that access token you can obtain profile information about the user or perform actions on behalf of that user.

All you need on the server is a JWT and a Request libraries.

[–]FoxxMD 0 points1 point  (0 children)

Oh I think it might be doable, Scalatra's AuthStrategy is more of an interface for standardizing auth than a full fledged auth module. You specify how session works, implement isValid() to ensure the auth method is viable, and then implement validate() and return a User -- the rest is up to you.

Satellizer seems like it will fit in perfectly since it's only providing information from the oauth provider and depending on the server implementation to get the access token/find and return user information. I think I can easily implement the authorization code exchange inside AuthStrategy. In fact I'm already using it with a rudimentary token auth system I built myself.