简体   繁体   中英

Verifying entered email address in Java Application for Google App Engine

I have a Java Web Application that gets information from the user. Before processing the information I wanted to make sure the email entered by the user belongs to the community.

I was originally going to have a file listing everyone int the community's email address. Upon submit, grab the email and ensure it exists in the master file.

Can anyone recommend how to do this with Google App Engine platform?

Thanks so much!

UserService userService = UserServiceFactory.getUserService(); User user = userService.getCurrentUser();

if (user == null) {
      response.sendRedirect( "/login" );
}
out.print( user.getNickname() );

You can obtain the email address from the User class above. The code above checks if a user is already logged into the google account. There is Open authorization protocol that would enable you to see if the visitor is already logged into a site that supports oAuth protocol (like Facebook etc).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM