Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6349297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:35:18+00:00 2026-05-24T21:35:18+00:00

I am using the Secure module from play framework and its mostly working great.

  • 0

I am using the “Secure” module from play framework and its mostly working great. I can login a user by posting a from the the /login route in my application.

However, when I “create/signup” a new user, I would like for that user to be automatically logged in after user creation. This, I can’t seem to get working programmatically, i.e., by not having to post a form to login.

My current code for my user create action is like:

    public static void create(@Required @Email String email, @Required String password, @Required @Equals("password") String passwordConfirmation) {
        User user = new User(email);
        user.password = new Crypto().encryptAES(password);
    user.save();

        try {
        Secure.authenticate(email, password, false); // <== this is the action in secure module mapped to /login
    } catch(Throwable t) {
        t.printStackTrace();
    }
   }

So I manually call Secure.authentication(username, password, remember) method, but this just redirects me to the login page and not my target page.

I have a feeling that a cookie or something is not being set because I am calling Secure.authenticate directly and not via a request/response, but I’m just not sure.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:35:19+00:00Added an answer on May 24, 2026 at 9:35 pm

    One idea could be to set the username in the session (after user signed up successfully)

    session.put("username", username);
    

    This will make sure Secure.connected() return as expected.

    if you need ‘remember me’,

    if(remember){
         response.setCookie("rememberme", Crypto.sign(username) + "-" + username, "30d");
    }
    

    Actually this is what Secure module does after successful authentication.
    Check Secure module

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the standard Secure module from Play! 1.2.2. In this discussion I've seen
I'm using the Play Secure module and I would like to set the flash
I've setup my Play Framework 1.2.1 project to run from within IntelliJ using the
I need to secure my website without using the ASP.NET built in login controls
I'm developing a web service using Play Framework. My next step is to log
I am using Magento Enterprise, with a Datacash 3D Secure payment module. In the
I'm using the Secure FTP product from EnterpriseDT . The setup below worked for
I have users who are using secure-wave security. Evidently it is some sort of
Folks, I've got an ASP.NET MVC application that I am attempting to secure using
I am trying to connect to a secure server using Apache Commons HttpClient 3.1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.