A distributed single sign-on framework that supports cookies and tokens – XXL-SSO

A distributed single sign-on framework that supports cookies and tokens – XXL-SSO

2022-09-02 0 492
Resource Number 37480 Last Updated 2025-02-24
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

This issue recommends a distributed single sign-on framework – XXL-SSO.

XXL-SSO is a distributed single sign-on framework. Users only need to log in once to access all trusted applications. So far, XXL-JOB has been connected to the online product lines of many companies, such as e-commerce business, O2O business and big data operations, including: Dianping, Uxin used car, Migu Interactive, Wave software, 360 finance, Mobei technology, Lenovo, Jingdong, Evergrande, NetEase Yixin, Tick Travel, Huya and other 500+ enterprises, XXL-JOB is currently fully open source code, out of the box.

db157fce1b234d60ad6d18541d3833c6noop.image_

The main features of the framework:

API simple and intuitive, easy to use
Less dependence on the environment, low deployment and access costs
Support distributed deployment
Both the Server and Client support cluster deployment
Cross-domain applications can be connected to SSO authentication centers
Supports cookie-based and token-based access modes
Supports Web and APP access
The login and logout status of the system is shared by all servers and clients in real time

Architecture diagram:

89d4be46bbb7401e9266ea3f2e8879e0noop.image_

Quick start (Cookie example) :

1, source code compilation

- xxl-sso-server:Central authentication service, support cluster - xxl-sso-core:ClientEnd dependent -xxl-sso-samples:Single sign-on Client access Example project- xxl-sso-web-sample-springboot:Cookie access mode for users to access the browser,springbootversions- xxl-sso-token-sample-springboot:The springboot version is used in scenarios where cookies cannot be used, for example, apps and cookies are disabled

2、Deploy the Authentication Center (SSO Server)”

Project name: xxl-sso-server

Configuration description

Configuration file location: application.properties

// redis Address: such as"{ip}"、"{ip}:{port}"、"{redis/rediss}://xxl-sso:{password}@{ip}:{port:6379}/{db}";Multiple addresses separated by commasxxl.sso.redis.address=redis://127.0.0.1:6379// The validity window of the login state is 24 hours by default. When the validity window of the login state is half over, it is automatically extended by one periodxxl.sso.redis.expire.minute=1440

3、Deploy the Single Sign-on Client Access Example project”

Project name: xxl-sso-web-sample-springboot

maven dependency

<dependency>    <groupId>com.xuxueli</groupId>    <artifactId>xxl-sso-core</artifactId>    <version>${Latest stable release}</version></dependency>

Configure XxlSsoFilter

Reference code: com. XXL. Sso. Sample. Config. XxlSsoConfig

@Beanpublic FilterRegistrationBean xxlSsoFilterRegistration() {    // xxl-sso, redis init    JedisUtil.init(xxlSsoRedisAddress);    // xxl-sso, filter init    FilterRegistrationBean registration = new FilterRegistrationBean();    registration.setName("XxlSsoWebFilter");    registration.setOrder(1);    registration.addUrlPatterns("/*");    registration.setFilter(new XxlSsoWebFilter());    registration.addInitParameter(Conf.SSO_SERVER, xxlSsoServer);    registration.addInitParameter(Conf.SSO_LOGOUT_PATH, xxlSsoLogoutPath);    return registration;}

Configuration description

Configuration file location: application.properties

### xxl-sso     (CLientEnd SSO configuration)##### SSO ServerAddress of the authentication center (You are advised to configure the authentication center by using the domain name. On the local PC, you can modify the host file by referring to Section 2.5)xxl.sso.server=http://xxlssoserver.com:8080/xxl-sso-server##### Log out path, the value is the relative path of the Client applicationxxl.sso.logout.path=/logout##### Path exclusion Path, multiple Settings are allowed, and Ant expressions are supported. Used to exclude paths that do not need to be filtered by the SSO clientxxl-sso.excluded.paths=### redis   // redis address, like "{ip}""{ip}:{port}""{redis/rediss}://xxl-sso:{password}@{ip}:{port:6379}/{db}";Multiple "," separatedxxl.sso.redis.address=redis://xxl-sso:password@127.0.0.1:6379/0  

4、verification

Modify the Host file: Access the authentication center using a domain name to simulate cross-domain and online environments

### Add the following to the host file127.0.0.1 xxlssoserver.com127.0.0.1 xxlssoclient1.com127.0.0.1 xxlssoclient2.com

Run xxl-sso-server and xxl-sso-web-sample-springboot respectively.

Run xxl-sso-server and xxl-sso-web-sample-springboot respectively. 1. Address of the SSO authentication center:http://xxlssoserver.com:8080/xxl-sso-server2、Client01Application address:http://xxlssoclient1.com:8081/xxl-sso-web-sample-springboot/3、Client02Application address:http://xxlssoclient2.com:8081/xxl-sso-web-sample-springboot/

SSO Login/logout process verification

In normal cases, the login process is as follows: 1. Access the “Client01 Application Address “and you will automatically redirect to the “SSO Authentication Center Address” login page. 2. After a successful login, the automatic redirect will return to the “Client01 Application Address “and switch to the logged in state. Client02 Application Address will be automatically switched to the login state without login. In normal cases, the logout process is as follows: 1. If you access the “Log Off path” configured in “Client01 Application Address”, the login status will be automatically redirected to the “SSO Authentication Center address “and the login status will be automatically logged off. 2

You can read more on your own.

开源地址:gitee.com/xuxueli0323/xxl-sso


如需项目推荐、获取资源请私信作者

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code A distributed single sign-on framework that supports cookies and tokens – XXL-SSO https://ictcoder.com/kyym/a-distributed-single-sign-on-framework-that-supports-cookies-and-tokens-xxl-sso.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service