Package com.okta.spring.example
Class HostedLoginCodeFlowExampleApplication
java.lang.Object
com.okta.spring.example.HostedLoginCodeFlowExampleApplication
@SpringBootApplication
@EnableGlobalMethodSecurity(prePostEnabled=true,
securedEnabled=true)
public class HostedLoginCodeFlowExampleApplication
extends Object
This example renders a self-hosted login page (hosted within this application). You can use a standard login with less
code (if you don't need to customize the login page) see the 'basic' example at the root of this repository.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.context.ApplicationListener
<org.springframework.security.authentication.event.AuthenticationSuccessEvent> Create an ApplicationListener that listens for successful logins and simply just logs the principal name.org.springframework.security.oauth2.client.OAuth2AuthorizedClientService
static void
com.fasterxml.jackson.databind.ObjectMapper
org.springframework.web.client.RestTemplate
-
Constructor Details
-
HostedLoginCodeFlowExampleApplication
public HostedLoginCodeFlowExampleApplication()
-
-
Method Details
-
main
-
authenticationSuccessEventApplicationListener
@Bean protected org.springframework.context.ApplicationListener<org.springframework.security.authentication.event.AuthenticationSuccessEvent> authenticationSuccessEventApplicationListener()Create an ApplicationListener that listens for successful logins and simply just logs the principal name.- Returns:
- a new listener
-
idxClient
-
authorizedClientService
@Bean public org.springframework.security.oauth2.client.OAuth2AuthorizedClientService authorizedClientService() -
helperUtil
-
restTemplate
@Bean public org.springframework.web.client.RestTemplate restTemplate() -
objectMapper
@Bean public com.fasterxml.jackson.databind.ObjectMapper objectMapper()
-