All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.smartcosmos.cluster.auth.UserResource Maven / Gradle / Ivy

Go to download

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