dev.snowdrop.vertx.sample.http.oauth.HelloController Maven / Gradle / Ivy
package dev.snowdrop.vertx.sample.http.oauth;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
@RestController
public class HelloController {
@GetMapping
public Mono hello(@AuthenticationPrincipal OAuth2User oauth2User) {
return Mono.just("Hello, " + oauth2User.getAttributes().get("name") + "!");
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy