У меня есть это в код:
Код: Выделить всё
@ApplicationPath("/")
@OpenIdAuthenticationDefinition(
providerURI = "https://my-idp.com/auth",
clientId = "my-app-id",
clientSecret = "my-app-secret",
redirectURI = "http://localhost:8080/myapp/oauth2/callback",
scope = "openid"
)
@DeclareRoles({"my_role"})
public class MyApp extends Application {
}
Код: Выделить всё
@Path("/my")
@RequestScoped
public class TestResource {
@Context
SecurityContext securityContext;
@GET
@Path("resource")
@Produces(MediaType.TEXT_PLAIN)
@RolesAllowed("my_role")
public String getName() {
return securityContext.getUserPrincipal().getName();
}
}
Если да, то почему работает часть авторизации?
Подробнее здесь: https://stackoverflow.com/questions/783 ... yara-micro