1,pac4j是什么?
pac4j是一個支持多種支持多種協議的身份認證的Java客戶端。
2,pac4j的12種客戶端認證機制:目前我只有用過第一和第八種。
-
OAuth (1.0 & 2.0): Facebook, Twitter, Google, Yahoo, LinkedIn, Github... using the
pac4j-oauth
module -
CAS (1.0, 2.0, SAML, logout & proxy) + REST API support using the
pac4j-cas
module -
HTTP (form, basic auth, IP, header, GET/POST parameter authentications) using the
pac4j-http
module -
OpenID using the
pac4j-openid
module -
SAML (2.0) using the
pac4j-saml
module -
Google App Engine UserService using the
pac4j-gae
module -
OpenID Connect 1.0 using the
pac4j-oidc
module -
JWT using the
pac4j-jwt
module -
LDAP using the
pac4j-ldap
module -
relational DB using the
pac4j-sql
module -
MongoDB using the
pac4j-mongo
module -
Stormpath using the
pac4j-stormpath
module.
3,maven配置

1 <dependency> 2 <groupId>org.pac4j</groupId> 3 <artifactId>spring-security-pac4j</artifactId> 4 <version>1.4.3</version> 5 </dependency> 6 <dependency> 7 <groupId>org.pac4j</groupId> 8 <artifactId>pac4j-oauth</artifactId> 9 <version>1.8.8</version> 10 </dependency>
主要是三個jar包:
4,下面是我收藏的項目鏈接,對於各種認證機制的學習非常有幫助:
項目主頁:http://www.open-open.com/lib/view/home/1418870307933