Spring Security Oauth2.0 报错At least one redirect_uri must be registered with the client

  • A+
所属分类:Spring Security

Spring Security Oauth2.0 报错OAuth Error
error="invalid_request", error_description="At least one redirect_uri must be registered with the client."

解决方法:在认证Server端里的AuthorizationServerConfigurerAdapter继承类的configure里加上redirectUris("http://localhost:8082/ui/login")即可。

@Override
    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
        clients.inMemory()
                .withClient("SampleClientId")
                .secret("secret")
                .authorizedGrantTypes("authorization_code")
                .scopes("user_info")
                .autoApprove(true)
                .redirectUris("http://localhost:8082/ui/login");
    }

 

ZPY

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: