generation of spam. In the previous blog, I used the Transport connect (host, port, username, password) method for verification. In fact, we can also perform verification when obtaining the Session object. There are two methods in the Session object: getDefaultInstance (prop, authenticator) and getInstance (prop, authenticator). Both methods have a common parameter aut
*/
public class Simplemailsender {
/**
* Send mail in text format
* @param mailinfo messages to be sent
*/
public boolean sendtextmail (Mailsenderinfo mailinfo) {
To determine whether an identity certificate is required
Myauthenticator authenticator = null;
Properties Pro = Mailinfo.getproperties ();
if (Mailinfo.isvalidate ()) {
If authentication is required, create a password validator
Authenticato
verify whether the user can perform the operation; Realm can be regarded as DataSource, that is, the safe data source.
That is to say for us, the simplest one Shiro application:
The application code is authenticated and authorized through Subject, and Subject is entrusted to SecurityManager; we need to inject SecurityManager into Shiro's Realm so that SecurityManager can be legally used. Households and their rights to judge.
As you can see from the above, Shiro does not provide the maintenance
in order to understand, I translated the overview section of the Accountmanager class. Reprint Please specify source: http://www.cnblogs.com/vir56k/p/4025722.htmlAccountmanager OverviewThis class provides the ability to access a centralized registry of users ' online accounts. The user enters authentication information for each account (credentials, which contains the user name and password), and clicks once (one-click) to complete the authentication, authorizing the application (app) to access
/response,
Then put a token that passes the verification in the user's session, and then the filter determines whether to allow response each time based on the token.
This mode is divided:
Keeper: filters or unified servlet.
Authenticator: Use JAAS to implement it on the web.
User qualification storage LDAP or database:
1. The Keeper intercepts and checks each protected resource. First, check whether this user has been created.
Good login session. If
class simplemailsender {/***//*** Send emails in text format* @ Param mailinfo information of the email to be sent*/Public Boolean sendtextmail (mailsenderinfo mailinfo ){// Determine whether identity authentication is requiredMyauthenticator authenticator = NULL;Properties pro = mailinfo. getproperties ();If (mailinfo. isvalidate ()){// If You Need identity authentication, create a password authenticatorAuthenticator = new myauthenticator (mailinfo.
informationSession session = session. getinstance (props, null );In the two methods, the null parameter is an authenticator object, which is not used here, so it is null.In most cases, using a shared session is enough.
Message----------------------------------------------------------------IOnce you have created a session object, the following is to create a message for sending. Message is an abstract class. In most applications, you can use its sub-c
abstract class. You are using javax. Mail. Internet. internetaddressThe mail address class, like the message class, is also an abstract class, so we will use the javax. Mail. Internet. internetaddress subclass.4. authenticator classLike the java.net class, the javamail API uses the authenticator class to access the protected resources by using the user name and password. Here "resource" refers to the mail
: Indicates the type of EAP packet, a total of 4 kinds: request,response,success,failure.Identifier: Assists in matching request and response messages.The length of the LENGTH:EAP package, containing the entire contents of code, Identifier, length, and data, in bytes.Data: determined by code.Success and failure types of packages do not have a data domain, and the corresponding length field has a value of 4. The data domain of the request and response type packets is shown in format 1-5.Figure 5
Step through the process of working with the Kerberos protocolThis article is I read this English explanation after the self-summary, has not finished writing ...Https://technet.microsoft.com/zh-cn/library/cc961976.aspxIs summed up, not translation, so I read the following according to their own understanding of the written, if there is a problem, please correct me!The word Kerberos is a three-head dog in Ancient Greek mythology, the dog guarding the gates of hell and preventing the living from
processing mechanism in detail.For example, we use the Shiro architecture diagram to explain the internal processing sequence of Shiro certification:1. The application constructs an AuthenticationToken instance for end user authentication information and calls the Subject. login method.2. The Sbuject instance is generally an Instance Object of the DelegatingSubject class (or subclass). At the beginning of authentication, the securityManager instance set by the application is entrusted to call t
request point-to-point re-authentication when the client does not have its own locally cached copy, called "Unspecified end-to-end revalidation", or when the client does not have a locally cached copy, called the "specific End-to-end Revalidation ".The client can specify three actions via the Cache-control request command:End-to-end ReloadThe request contains a "No-cache" cache control directive, or "pragma:no-cache" for compatibility with the http/1.0 client. The No-cache directive in the requ
javax.mail.internet.InternetAddress;Import Javax.mail.internet.MimeBodyPart;Import Javax.mail.internet.MimeMessage;Import Javax.mail.internet.MimeMultipart;
/*** Simple Mail (message without attachment) transmitter*/public class Simplemailsender {/*** Send mail in text format* @param mailinfo messages to be sent*/public boolean sendtextmail (Mailsenderinfo mailinfo) {To determine whether an identity certificate is requiredMyauthenticator authenticator
SecurityManager, is the core of Shiro.Authenticator: The authenticator, the main body carries on the attestation finally through the authenticator carries on.Authorizer: The authorization, the subject to authorize the final through the authorizer.Sessionmanager:web application is generally used to manage the session with a Web container, Shiro also provides a set of session management methods.Sessiondao: U
Session. If you get the session, it indicates that you have connected to the mail server, after completing the first step, the Connection is established, and its function is similar to that of JDBC Connection.How can we get the Session?
By checking the j2ee document, we can find two methods: 1. session. getInstance (Properties prop); 2. session. getInstance (Properties prop, Authenticator auth);, this method returns a Session, but requires two parame
returns the billing start response packet (accounting-response );F. The radius client sends a billing stop request packet (accounting-request) to the RADIUS server. The value of status-type is stop;G. The RADIUS server returns the billing end response packet (accounting-response ).(3) packet structure of RADIUS protocolRadius uses UDP to transmit messages. It uses the timer management mechanism, retransmission mechanism, and backup server mechanism to ensure that the interactive messages betwee
I saw the email development video explained by Zhang Xiaoxiang, but I only watched a small part of it. At that time, I was a little newbie and didn't understand it. I thought it was a very complicated technology. The mail sending function is used in a small project that has recently been practiced. This function is implemented by referring to the Code on the Internet. Now, it's so easy!
Before enabling this function, you need to download the jar package mail. Jar required for sending emails. Yo
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.