@@ -0,0 +1,1161 @@
+package it.reply.orchestrator.service.security;%0A%0Aimport it.reply.orchestrator.dto.security.IndigoOAuth2Authentication;%0A%0Aimport org.springframework.beans.factory.annotation.Value;%0Aimport org.springframework.context.annotation.PropertySource;%0Aimport org.springframework.security.core.Authentication;%0Aimport org.springframework.security.core.context.SecurityContextHolder;%0Aimport org.springframework.stereotype.Service;%0A%0A@Service%0A@PropertySource(value = %7B %22classpath:security.properties%22 %7D)%0Apublic class OAuth2TokenService %7B%0A%0A  @Value(%22$%7Bsecurity.enabled%7D%22)%0A  private boolean securityEnabled;%0A%0A  public boolean isSecurityEnabled() %7B%0A    return securityEnabled;%0A  %7D%0A%0A  public String getOAuth2Token() %7B%0A    if (!securityEnabled) %7B%0A      throw new IllegalStateException(%22Security is not enabled%22);%0A    %7D%0A    Authentication auth = SecurityContextHolder.getContext().getAuthentication();%0A    if (auth == null %7C%7C !(auth instanceof IndigoOAuth2Authentication)) %7B%0A      throw new IllegalStateException(%22User is not authenticated%22);%0A    %7D%0A    IndigoOAuth2Authentication indigoAuth = (IndigoOAuth2Authentication) auth;%0A    return indigoAuth.getPrincipal().toString();%0A  %7D%0A%7D%0A

Add Service to obtain authN info