request.getRemoteUser()
SecurityContext context = SecurityContextHolder.getContext();
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
In order to log the user in automatically after signup, I discovered that Ineeded to place the SecurityContext in the session. I did this by changing
the following code in SignupController:
// log user in automatically
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(user.getUsername(), user.getConfirmPassword(),user.getAuthorities());
auth.setDetails(user);
SecurityContextHolder.getContext().setAuthentication(auth);
To:
// log user in automatically
UsernamePasswordAuthenticationToken auth = new
UsernamePasswordAuthenticationToken(
user.getUsername(), user.getConfirmPassword(), user.getAuthorities());
auth.setDetails(user);
SecurityContext context = SecurityContextHolder.getContext();
context.setAuthentication(auth);
request.getSession().setAttribute("ACEGI_SECURITY_CONTEXT", context);
Hope this helps someone!
分享到:
相关推荐
var user = web.get_currentUser(); // 加载用户属性 context.load(user); // 执行查询并处理结果 context.executeQueryAsync( function() { console.log('用户名:' + user.get_title()); console.log('...
11. Do not forget to provide an event handler for the Logon so the Postback can handle the user authentication properly. 12. All rights reserved to the control author - aspnet100@yahoo....
In each chapter of this book, you’ll learn how these technologies can work together inside a Rails app to deliver well-performing applications that offer great user experiences. Create a usable and...
We will explore the components of this new version of the framework and discover how to use each component, the options available, and how to get the most from each component. Whilst learning ...
See how creating an advanced Postgres index for a case-insensitive search speeds up your back end - enabling you to create a dynamic user experience using Angular 2. Create reusable components that ...
在Linux上,你可以使用apt-get(Ubuntu/Debian)或yum(CentOS/RHEL)来安装Apache、PHP和MySQL。在Windows上,你可以下载并安装XAMPP或WAMP套件。 步骤2:安装MySQL 创建一个新的数据库和用户,记下数据库名、...
How to get a APK Download WeGit from 腾讯应用宝、Google play You can download an apk from here You can also scan the below QR code to download apk in your mobile phone. Bug Q:Crush after ...
9. **Customizing User Configurations (HACK 9):** Here, users learn how to customize various aspects of their environment, such as terminal settings, window manager configurations, and application ...
How Hackers Get around Access Control How to Improve upon Access Control Memco SeOS APIs Impact of SeOS on Base Operating System Security SeOS Auditing Other SeOS Features Going beyond SeOS ...
- bugfix: Fixed an issue with cookies that didn't allow you to login to two OpenGoo installations on the same server, or an OpenGoo installation and a Joomla installation - bugfix: Fixed some ...
<END><br>8,下载_script.zip This 下载 counter script uses ASP file system object to get the size of the 下载 file and to track how many times a file is already 下载ed. <END><br>9,k-base.zip K ...
So 下载 the code and get involved with the News Group, help us to help you.<END><br>4 , urllink.zip User control to launch web browser and jump to URL.<END><br>5 , vbftp.zip Sample application ...
To get started with Mac4Lin, users need to follow a series of steps outlined in the documentation. These steps cover everything from downloading and installing the pack to fine-tuning various aspects ...
how to improve eric5. If the required packages (Qt4, QScintilla2, sip and PyQt4) are not installed, please get them and install them in the following order (order is important). 1. Install Qt...
Sends the email, requires valid outlook profile name, recipient email address and a login session to send email. Steps to execute the demo project The demo project demonstrates the way you can ...
sorry =)- Minor changes to the code.1.0- Developed with WSockets 1.2 POP.Login now return a boolean depending id the user is authorized, and POP.Init return the number of new msgs.1.01- Fixed a bug ...
consultants the possiblity to show how easy it would be to gain unauthorized access from remote to a system. THIS TOOL IS FOR LEGAL PURPOSES ONLY! There are already several login hacker tools ...