RAuth token based authentication system build on top of Java and Redis.
The general concept behind a RAuth token-based authentication system is simple. Allow users to enter their username and password in order to obtain a token which allows them to fetch a specific resource - without using their username and password. Once their token has been obtained, the user can offer the token - which offers access to a specific resource for a time period - to the remote site.
RAuth is a java library which provides token-based authentication system for all type of java projects or can run independently to support your existing system.
app.properties
file. For linux and unix operating systems it should be /opt/rauth/
and for windows it should be C:\rauth
. Download property file from here: app.properties. I will write detail explaination of it soon.RAuth.authUser("USERNAME", "PASSWORD");
. This method will return User
object. Payload is a JWT term represents content/information you want to put inside your token. Read more about JWT here.
User u = RAuth.authUser("username", "password");
if(u.getUserStatus().equals(UserStatus.ACTIVATE)) {
/*
* Add Your ACL Code Here ! RAuth future release will have it.
*/
String rtoken = RAuth.issueJwt(Audience, Payload);
}
RAuth.authJwt(Audience, jwt)
returns payload from the token. Extract and verify token from its payload.
That's it. Isn't it really simple?Thanks for checking this out. If you have any questions, I'll be on Twitter. If you're using this, let me know! I'd love to see it. Let's make a simple, secure & scalable authentication system together!