Scalatra API Authentication Authentication Module

I am creating a RESTful API on top of Scala. As a newbie to the framework, I'm not quite sure if there is a solution out there that will help me authenticate users against the API using some token-based system (rather than OAuth). There should be nothing fancy, I just can not find anything useful on Google. Since the framework is well suited for creating a REST API, is there perhaps something already there to help authorized users use a token-based system?

+4
source share
2 answers

Jos Dirksen has a tutorial that includes sample code for HMAC auth with Scalatra, he:

http://www.smartjava.org/content/tutorial-getting-started-scala-and-scalatra-part-iii

It may or may not meet the needs of your implementation, but it will give you an idea of ​​one way to solve the problem.

+2
source

If you need to create a unique, hashed, and random token in scala for Token API calls, here is an example class

https://gist.github.com/jeffsteinmetz/063bd3237033f3af2ed9

0
source

Source: https://habr.com/ru/post/1486957/


All Articles