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

  • Home
  • SEARCH
  • 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 6580069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:58:44+00:00 2026-05-25T15:58:44+00:00

I have a Security class that looks like this: package controllers; import play.Logger; public

  • 0

I have a Security class that looks like this:

package controllers;

import play.Logger;

public class Security extends Secure.Security {
  static boolean authenticate(String username, String password) {
    return password.equals("banan");
  }

  static boolean check(String profile) {
    Logger.info("profile: %s", profile);
    if ("user".equals(profile)) {
      Logger.info("connected: %s", connected());
      return connected().equals("user");
    }

    return false;
  }

  static void onAuthenticated() {
    Logger.info("Login by user %s", connected());
  }

  static void onCheckFailed() {
    Logger.info("Check failed!", "omg");
  }

  static void onDisconnect() {
    Logger.info("Logout by user %s", connected());
  }

  static void onCheckFailed(String profile) {
    Logger.warn("Failed auth for profile %s", profile);
    forbidden();
  }
}

And a Controller that looks like this:

@Check("user")
@With(Security.class)
public class Person extends Controller {

  public static void create() {
    List<models.person.Person> persons = models.person.Person.find(
        "order by createdAt desc").fetch(10);

    render(persons);
  }
}

The check method never gets called. Not even the checkAccess (in the Secure class) gets called. 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-25T15:58:45+00:00Added an answer on May 25, 2026 at 3:58 pm

    From looking at the code you have posted, the one error I can see (if you compare to the instructions on the secure module page), is that you should use @With(Secure.class).

    So, change your code from

    @Check("user")
    @With(Security.class)
    public class Person extends Controller {
    

    to

    @Check("user")
    @With(Secure.class)
    public class Person extends Controller {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code that looks like the following in a class that extends MembershipProvider
I have a RentalProperty class which looks something like this: class RentalProperty { Money
I have data in R that can look like this: USDZAR Curncy R157 Govt
I have a security consultant demanding that we implement encrypted connections to mySQL. He
Is there a way to see users that have certain security role assigned? I'm
I have a compiled class library containing a user control and I'd like to
I have a WCF service with a security class for getting some of the
I would like to have a custom snippet of html form code that takes
I have a class library that has it's own model and connectionstring to the
Let's say I have some classes defined as follows: class Security { Boolean AuthenticateUser(String

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.