package fr.doap.qodo;

import io.quarkus.security.*;
import io.quarkus.security.identity.*;
import jakarta.annotation.security.*;
import jakarta.inject.*;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.*;
import org.eclipse.microprofile.jwt.*;
import org.jboss.resteasy.reactive.*;

@Path("/oidc")
@Authenticated
public class TestOIDC {
	
	@Inject
	SecurityIdentity mIdentity;
	
	@Inject
	JsonWebToken jwt;
	
	@RolesAllowed("user11")
	@GET
	@Produces(MediaType.TEXT_PLAIN)
	@NoCache
	public String get() {
		System.out.println("Backend Server at 8080: "+mIdentity);
		System.out.println("Backend Server at 8080: "+mIdentity.getPrincipal());
		return jwt.toString();
	}
}
