Online check a lot, no effect, wrote a, although a bit, but the function can still be realized. Talk less, look at the shell.#!/bin/shfunction main {lines= ' Ps-eo user,pid,cmd | grep-v root |grep sshd '; tmp=0;array= (); for i in ${lines[*]}doif [$ (($tmp%4))-eq 0-o $ (($tmp%4)-eq 1]thenarray= (${array[@]} $i) fitmp=$ (($tmp + 1));d onefor I in ${array[*]}dotmp=0;for (( j=0;jLinux Single Sign-on shell
I based on the framework of the use of OAuth2.0 summary, drawing a user name + password to achieve OAuth2.0 login certification flowchart, today we look at the logout process:/** * 用户注销 * @param accessToken * @return */ @RequestMapping(value = "/user/logout", method = RequestMethod.POST) public ResponseVO userLogout(@RequestHeader(value = "accessToken", required = true) String accessToken, @RequestHeader(value = "userId", required = true) Long userId) throws Exception{
I based on the framework of the use of OAuth2.0 summary, drawing a user name + password to achieve OAuth2.0 login certification flowchart, today we look at the logout process: /** * User logoff * @param accesstoken * @return */@RequestMapping (value = "/user/logout", Metho D = requestmethod.post) public Responsevo userlogout (@RequestHeader (value = "Accesstoken", required = true) String access Token, @RequestHeader (value = "userid", required = True) Long userId) throws exception{Oauthaccesstok
Boolean authenticateusernamepasswordinternal (final usernamepasswordcredentials Credentials) throws Authenticationexception {
//Get the value passed by the foreground, username and password
final String username = Getprincipalnametransformer (). Transform (Credentials.getusername ());
Final String password = Credentials.getpassword ();
Final String Encryptedpassword = This.getpasswordencoder (). Encode (
password);
try {
final
1. Prerequisites:Requires a single sign-on with ASP. NET-brought form validation (FormsAuthentication)The configuration file is written as follows (Basic):enableCrossAppRedirects: Whether to use across applicationsName: Specifies the cookie name that is written to the browser after validation is passed, while verifying that the cookie name is read, gets the value, and then decrypts the assigned value to Use
= "") {var httpClient = new Htt pclient {baseaddress = new Uri (configurationmanager.appsettings["Ssopassport"])}; var RequestUri = string. Format ("Api/passport?sessionkey={0}remark={1}", SessionKey, remark); try {var resp = Httpclient.getasync (RequestUri). Result; Resp. Ensuresuccessstatuscode (); Return resp. Content.readasasyncSample SSO Validation Attribute usage:[Ssoauth] public class Homecontroller:controller {public actio
This article turns to self-blog, reprint please declare address: http://www.heartlifes.com/archives/7/ background:
1. The project uses Yale's CAs for single sign-on. 2. Using the Spring-oauth package to implement OAUTH2 Services 3. Use Spring-cas to do spring-security and CAS integration phenomena:
Development reported a bug, the approximate process is the system call/oauth/authorize interface, was spring-s
This article draws on the single sign-on CAS series section No. 04.
First of all we want to import CAs into MyEclipse, the specific method (self-created project, gradle), I used the first method, after the creation of a Web project, the compiled files copied to the project, the directory must be correct Oh,
As shown in figure:
1, CSA's default login user password configuration in deployerconfigcontext.xml,
=" Max"Scheme="HTTPS"Secure="true"ClientAuth="false"Sslprotocol="TLS"/>--Remove the comment and change it to the following code:"8443"Protocol="Org.apache.coyote.http11.Http11Protocol"MaxThreads=" Max"Sslenabled="true"Scheme="HTTPS"Secure="true"Keystorefile="G:\tomcat.keystore"Keystorepass="Tomcat"ClientAuth="false"Sslprotocol="TLS"/>The meanings of the items are shown in the following table:Then open the https://localhost:8443 in the browser, the following interface shows that the configuration
SSO (single sign-on) is the name of a number of sub-projects that share one login point. The principle is simply that server session sharing, client cross-domain cookies.The implementation is very simple, protected/config/main.php the session configuration can be modifiedThe code is as follows:1 $host=Explode(‘.‘,$_server["Http_host"]);2 if(Count($host) > 2) {3 Define(' DOMAIN ',$host[1]. ‘.‘ .$host[2])
: When developing debugging, using browser monitoring to see the return output values, I was using chrome F12 to open the Network tab.
Detailed examples
The so-called single sign-on, is nothing more than a few sites share a user center, to achieve synchronous landing, synchronous exit.
Server-side: Loog SSO
Customer Service: Ucenter, to tell the truth dz Commercialization really let PHP develop a lot.
Ucent
Tags: cyclic output server load good Single sign-on XLS inpu description 1.2"Introduction to the Environment" System environment: Linux + Oracle 11.2.0.4.0 + python 2.7.10 "Background description" Requirements: Because of the production database involved more, business boast multiple database use. When the business has some impact, the database side if BOMC did not immediately receive the relevant alarm, t
"},"Roleids": "100","TokenInfo": { "accessToken":"4de55a69-e372-4766-acd3-1c419d6f2fda", "tokenType": "bearer", "webTokent":"uHSLjfJoQwU4t4PAqCzH1SN0fp7PUWKluPNS+x1dZ8R9Gx+NJkBI7w==", "refreshToken":"d3d71594-5c3f-4a68-a7e5-b8d21c4fa73b", "expiresIn": 34644, "scope": "read write"}}}Note: You can test with the Postman toolFramework Design idea: Provide independent Commonservice-sso microservices, provide component-sso dependent components, and provide micro-service client User-service Micro-servi
On the basis of a summary of the use of OAuth2.0 in the framework, the OAuth2.0 logout process of SSO single sign-on was drawn, today we take a look at the process of obtaining yoghurt information based on user token: /*** Get user information based on token *@paramAccesstoken *@return * @throwsException*/@RequestMapping (Value= "/user/token/{accesstoken}", method =requestmethod.get) PublicResponsevo
Label: followed by the introduction of the CAS-based single sign-on (SSO) demonstration, the service-side authentication mechanism in the demonstration process is the default configuration is CAS Servier The Default user name and password are consistent to log in successfully, then this article will focus on the application, really by querying the user name password to process to verify whether the user can
]", "Status":"1", "Createtime":"2017-06-26" }, "Roleids":" -", "TokenInfo": { "Accesstoken":"4DE55A69-E372-4766-ACD3-1C419D6F2FDA", "Tokentype":"Bearer", "webtokent":"uhsljfjoqwu4t4paqczh1sn0fp7puwklupns+x1dz8r9gx+njkbi7w==", "Refreshtoken":"d3d71594-5c3f-4a68-a7e5-b8d21c4fa73b", "Expiresin":34644, "Scope":"Read Write" } } }
Note: You can test with the Postman tool
Framework Design idea: Provide independent Commonservice-sso m
On the basis of a summary of the use of OAuth2.0 in the framework, the OAuth2.0 logout process of SSO single sign-on was drawn, today we take a look at the process of obtaining yoghurt information based on user token: /*** Get user information based on token *@paramAccesstoken *@return * @throwsException*/@RequestMapping (Value= "/user/token/{accesstoken}", method =requestmethod.get) PublicResponsevo G
": "100","TokenInfo": {"Accesstoken": "4DE55A69-E372-4766-ACD3-1C419D6F2FDA","Tokentype": "Bearer","Webtokent": "uhsljfjoqwu4t4paqczh1sn0fp7puwklupns+x1dz8r9gx+njkbi7w==","Refreshtoken": "d3d71594-5c3f-4a68-a7e5-b8d21c4fa73b","Expiresin": 34644,"Scope": "Read Write"}}}Note: You can test with the Postman toolFramework Design idea: Provide independent Commonservice-sso microservices, provide component-sso dependent components, and provide micro-service client User-service Micro-service interface f
On the basis of a summary of the use of OAuth2.0 in the framework, the OAuth2.0 logout process of SSO single sign-on was drawn, today we take a look at the process of obtaining yoghurt information based on user token:Java code
/**
* Get user information based on token
* @param accesstoken
* @return
* @throws Exception
*/
@RequestMapping (value = "/user/token/{accesstoken}", method = Requestm
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.