Example usage for org.springframework.security.oauth2.config.annotation.configurers ClientDetailsServiceConfigurer inMemory

List of usage examples for org.springframework.security.oauth2.config.annotation.configurers ClientDetailsServiceConfigurer inMemory

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.config.annotation.configurers ClientDetailsServiceConfigurer inMemory.

Prototype

public InMemoryClientDetailsServiceBuilder inMemory() throws Exception 

Source Link

Usage

From source file:net.prasenjit.security.login.OAuthConfigurer.java

@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.inMemory().withClient("client1").secret("secret1").scopes("openid")
            .authorizedGrantTypes("authorization_code", "refresh_token");
}

From source file:com.springthunder.config.OAuth2Config.java

@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.inMemory().withClient("client").secret("secret")
            /** Two grant types are handled:
             * - password: It requires user management creation beforehand
             * - client_credentials : It just requires client credentials
             *///from   w w w . j  av  a2 s.c o m
            .authorizedGrantTypes("password", "client_credentials").scopes("read", "trust")
            .authorities("ROLE_CLIENT"); //AUTHORITIES GRANTED

}

From source file:bookmarks.OAuth2Configuration.java

@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {

    clients.inMemory().withClient("android-" + applicationName)
            .authorizedGrantTypes("password", "authorization_code", "refresh_token").authorities("ROLE_USER")
            .scopes("write").resourceIds(applicationName).secret("123456");
}

From source file:org.test.config.OAuthConfig.java

@Override
public void configure(final ClientDetailsServiceConfigurer clients) throws Exception {
    clients.inMemory().withClient("test").accessTokenValiditySeconds(3)
            //30 minutes
            .refreshTokenValiditySeconds(60 * 30).authorizedGrantTypes("password", "refresh_token")
            .scopes("read", "write");
}

From source file:org.openbaton.nfvo.security.authentication.OAuth2AuthorizationServerConfig.java

@Override
public void configure(ClientDetailsServiceConfigurer client) throws Exception {
    client.inMemory().withClient("openbatonOSClient").secret("secret")
            .authorizedGrantTypes("authorization_code", "refresh_token", "password").scopes("read", "write")
            .resourceIds(RESOURCE_ID);//www.ja v a 2 s.  c  om
}

From source file:com.create.application.configuration.OAuthConfiguration.java

@Override
public void configure(final ClientDetailsServiceConfigurer clients) throws Exception {
    clients.inMemory().withClient("postman").authorities(ROLE_ADMIN).secret("password")
            //                .refreshTokenValiditySeconds()
            //                .accessTokenValiditySeconds()
            .resourceIds(RESOURCE_NAME).scopes("read", "write").authorizedGrantTypes("client_credentials")
            .secret("password").and().withClient("web").redirectUris("http://github.com/create1st/")
            .resourceIds(RESOURCE_NAME).scopes("read").authorizedGrantTypes("implicit");
}

From source file:org.moserp.infrastructure.authentication.AuthorizationServerConfig.java

@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.inMemory().withClient("web")
            .authorizedGrantTypes("authorization_code", "client_credentials", "refresh_token", "password",
                    "implicit")
            .scopes("read", "write", "openid").accessTokenValiditySeconds(3000).and().withClient("android")
            .authorizedGrantTypes("authorization_code", "client_credentials", "refresh_token", "password",
                    "implicit")
            .scopes("read", "write", "openid").accessTokenValiditySeconds(3000);
}

From source file:com.melayer.camzia.config.MeConfigOAuth2Server.java

@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    //super.configure(clients); 

    clients.inMemory().withClient("me").secret("111")
            .authorizedGrantTypes("password", "authorization_code", "refresh_token", "implicit")
            .scopes("camzia").autoApprove("camzia").authorities("USER").accessTokenValiditySeconds(60000);
}

From source file:tld.mydomain.example.config.ExampleAuthServerConfig.java

@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    // @formatter:off

    clients.inMemory()
            /*   // w  ww.ja  v a 2  s.c  om
            .withClient(trustedClientId())
               .authorizedGrantTypes("password", "refresh_token")
               //.authorities(SYSTEM_CLIENT_ROLE)
               .scopes("read", "write")
               .resourceIds(resourceIds())
               .secret(trustedClientSecret());
                    
            /*
            .and()
            */
            .withClient("web").redirectUris(getDefaultRedirectUris()).resourceIds(getResourceIds())
            //.scopes("read", "write")
            .authorizedGrantTypes("implicit");
    /*
    .and()
       .withClient(APPSERVER_CLIENT_ID)
       .secret(APPSERVER_CLIENT_SECRET)
       .authorizedGrantTypes("client_credentials","authorization_code")
       .scopes("read","write");
    */

    // @formatter:on
}

From source file:demo.OAuth2AuthorizationServerConfiguration.java

@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    ClientDetailsServiceBuilder<InMemoryClientDetailsServiceBuilder>.ClientBuilder builder = clients.inMemory()
            .withClient(this.details.getClientId());
    builder.secret(this.details.getClientSecret())
            .resourceIds(this.details.getResourceIds().toArray(new String[0]))
            .authorizedGrantTypes(this.details.getAuthorizedGrantTypes().toArray(new String[0]))
            .authorities(//from www .j  a v  a 2 s  . co m
                    AuthorityUtils.authorityListToSet(this.details.getAuthorities()).toArray(new String[0]))
            .scopes(this.details.getScope().toArray(new String[0]));

}