Adding more then one client to the Spring OAuth2 Auth Server

前端 未结 2 1493
不知归路
不知归路 2021-02-04 03:33

I have Spring OAuth Authorization server and I want to add support for more then one client(id). I configured clients like this:

clients
            .inMemory().         


        
2条回答
  •  清歌不尽
    2021-02-04 04:22

    Do not use multiple inMemory builders, instead concatenate multiple withClients inside one inMemory:

    @Override
    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
        clients.inMemory()
                    .withClient("first")
                    .secret("secret")
                    .scopes("read")
                    .authorizedGrantTypes("password")
                .and()
                    .withClient("sec")
                    .secret("secret")
                    .scopes("read")
                    .authorizedGrantTypes("password");
    }
    

提交回复
热议问题