我遇到了Play 2.7的安全问题 我已经在Java系统中建立了一个身份验证系统,但是当我尝试使用Scala控制器重用它时,
JAVA
@SomehowAuthenticated.Authenticated(BasicAuthenticated.class)
@AuthorizedProfiles(profiles = {UserProfileEnum.ADMIN})
public class MonitoringRestController extends AbstractSecuredController {
//rest of the code
}
SCALA
@SomehowAuthenticated.Authenticated(classOf[BasicAuthenticated])
@AuthorizedProfiles(profiles = Array(UserProfileEnum.ADMIN))
class PrometheusController @Inject()(registry: CollectorRegistry) extends AbstractSecuredController {
//rest of the code
}
但是由于某种原因,scala类中的身份验证根本不起作用! 我想念什么? 如果我将控制器转换为Java,它将起作用吗?