
net.smartcosmos.cluster.auth.UserResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smartcosmos-auth-server Show documentation
Show all versions of smartcosmos-auth-server Show documentation
SMART COSMOS Authorization Server handles authentication throughout the microservice fleet
The newest version!
package net.smartcosmos.cluster.auth;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.security.Principal;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* @author voor
*/
@RestController
public class UserResource {
@RequestMapping({ "/user", "/me" })
public Map user(Principal principal) {
Map map = new LinkedHashMap<>();
if (principal != null) {
map.put("name", principal.getName());
}
return map;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy