You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
672 B
27 lines
672 B
package com.redhat.pctsec.rest.v1alpha1; |
|
|
|
import io.quarkiverse.kerberos.KerberosPrincipal; |
|
import io.quarkus.arc.profile.UnlessBuildProfile; |
|
import io.quarkus.security.Authenticated; |
|
import io.quarkus.security.identity.SecurityIdentity; |
|
import jakarta.inject.Inject; |
|
import jakarta.ws.rs.GET; |
|
import jakarta.ws.rs.Path; |
|
import jakarta.ws.rs.Produces; |
|
|
|
@UnlessBuildProfile("dev") |
|
@Path("/Kerberos") |
|
@Authenticated |
|
public class Kerberos { |
|
@Inject |
|
SecurityIdentity identity; |
|
@Inject |
|
KerberosPrincipal kerberosPrincipal; |
|
|
|
@GET |
|
@Path("/me") |
|
@Produces("text/plain") |
|
public String me() { |
|
return identity.getPrincipal().getName(); |
|
} |
|
}
|
|
|