欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

error: error=“invalid_grant“, does not match one of the registered values

程序员文章站 2022-05-12 23:33:41
...

详情:

error: error="invalid_grant", error_description="Invalid redirect: 
=uri does not match one of the registered values."

环境:
spring-security-oauth2

原因:
http://127.0.0.1:8003/oauth/authorize?client_id=client1&response_type=code&redirect_uri=uri 中的redirect_uri 和客户端信息不一致,如下代码中的redirectUris里的值

@Override
    public void configure(ClientDetailsServiceConfigurer clients) 
    throws Exception {
        clients.inMemory()
                .withClient("client1")
                //...
                .redirectUris("uri")
                .and()
               //...
    }