Another method for implementing synchronous Login

Source: Internet
Author: User

In many cases, point logon is a complicated design.

Now, a company is designing its own authentication center, that is, all systems send the login credential information to the authorization center,

If the center is verified successfully, a session is created and sent to your address to write cookies.

When you go to another sub-station, they will call your status in the authentication center and create a local session to log on to the authentication center if the status is correct.

However, this method is time-consuming and labor-consuming for general internal systems or systems with low security requirements.

Especially when the system has been formed, many enterprises need to spend a lot of time to transform the system, so it cannot slide.

It is a good method to create session login by using the key authentication method of WebService. Encryption

[Webmethod (enablesession =   True )]
Public   Bool Encryptconvert ( String UID)
... {
String Encrypttext = Convert. tobase64string (system. Text. encoding. Default. getbytes (encryptstring. Encrypt (UID). Replace ( " + " , " % 2B " ); // Encryption
If (Decrypt (encrypttext, UID )) // Call Decryption Method
... {
Session. Add (systemconst. key_cache_student, UID );
Return True;

}
Else
... {
Return False;
}
}

Read the previous articleArticleSomeone must have noticed the password-adding method. In the last sentence, the address is switched

It means to transmit the Encrypted Key to another system and decrypt it from another system. If the key pair is the same, create a session for the user to log on.

Note that the [webmethod (enablesession)= True)]

Otherwise, an error occurs.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.