Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The quickest way to support authentication on your app.

License

NotificationsYou must be signed in to change notification settings

encryptorcode/iam-oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven CentralLicenseCode ClimateDependabotSonatype Nexus (Snapshots)

The quickest way to support authentication on your app.

Installation

Maven

<dependency>  <groupId>io.github.encryptorcode</groupId>  <artifactId>iam-oauth</artifactId>  <version>2.0.1</version></dependency>

Groovy

implementation'io.github.encryptorcode:iam-oauth:2.0.1'

Kotlin DSL

implementation("io.github.encryptorcode:iam-oauth:2.0.1")

What?

This is a library for all your authentication needs.From the scratch it's made to give you full flexibility for advanced implementation,also making sure it's easy to implement for starters.

Usage

You need to write bare minimal to set up your authentication.

AuthenticationInitializer.newInstance(Session::new,User::new)        .addOAuthProvider(newGoogleAuthenticationProvider())        .initialize();
  • GoogleAuthenticationProvider An implementation for supporting Oauth 2.0 authentication using Google.
  • We also have ready-made implementations for supporting storage with files, db and redis.

For complete example, checkexample folder given in the repository.

Setting it up

To completely customising and setting up authentication you can follow the guides below.

  1. Configure your oauth provider(s)
  2. Create your User and Session implementations
  3. Customise your way to store of Users, Session and AuthenticationDetails
  4. Setup your security for your users
  5. Handle server requests

API

Getting instance of authentication service

AuthenticationService<Session,User>authenticationService =AuthenticationService.getInstance();

Getting the current user

UsercurrentUser =authenticationService.getCurrentUser();

Getting the current session

SessioncurrentSession =authenticationService.getCurrentUser();

Note: Both user and session will be set only in a HttpRequest. It will get a null if you invoke this on a TimerTask or Scheduler.

License

MIT

About

The quickest way to support authentication on your app.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp