@Bean
 protected AuthenticationEntryPoint authenticationEntryPoint() {
   OAuth2AuthenticationEntryPoint entryPoint = new OAuth2AuthenticationEntryPoint();
   entryPoint.setTypeName("Basic");
   entryPoint.setRealmName("oauth2/client");
   return entryPoint;
 }
 @Bean
 public OAuth2AuthenticationEntryPoint oauthAuthenticationEntryPoint() {
   OAuth2AuthenticationEntryPoint oAuth2AuthenticationEntryPoint =
       new OAuth2AuthenticationEntryPoint();
   oAuth2AuthenticationEntryPoint.setRealmName(this.applicationName);
   return oAuth2AuthenticationEntryPoint;
 }