Closed juhyun closed 2 years ago
According to the authlib document, if user uses'client_secret_basic' client auth method, 'HTTP Basic Authorization' can be used. However, with 'HTTP basic Authorization' it failed to get token.
Successfully getting token using "curl -u :" [root@server ~]# curl -u e7Ll5b67Xv5zZKZBuLLwoOWm:gkZICKnukGLDQmT0PMa1Yp2r11dKL7OmLjiKZFGwMPLRAGrn -XPOST http://127.0.0.1:5001/oauth/token -F grant_type=password -F username=opuser -F password=valid {"access_token": "MWptz8DVDYYfqYy6inSHq2phkvZZ6fyo8TgDEgEpKK", "expires_in": 864000, "refresh_token": "oQJpPhiTXi10AzfwNfoKQshvE4YosI86FMHY4ban5BzG7JI3", "token_type": "Bearer"}
Failed to get token using "encoded client credentials" [root@server ~]# echo -n 'e7Ll5b67Xv5zZKZBuLLwoOWm:gkZICKnukGLDQmT0PMa1Yp2r11dKL7OmLjiKZFGwMPLRAGrn' | base64 c [root@server ~]# [root@server ~]# curl -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic ZTdMbDViNjdYdjV6WktaQnVMTHdvT1dtOmdrWklDS251a0dMRFFtVDBQTWExWXAycjExZEtMN09tTGppS1pGR3dNUExSQUdybg==" -XPOST http://127.0.0.1:5001/oauth/token -F grant_type=password -F username=opuser -F password=valid {"error": "invalid_grant"}
-----------Updated--------------- Oh, without using '-H "Content-Type: application/x-www-form-urlencoded"', http basic authentication works fine..
According to the authlib document, if user uses'client_secret_basic' client auth method, 'HTTP Basic Authorization' can be used. However, with 'HTTP basic Authorization' it failed to get token.
Successfully getting token using "curl -u:"
[root@server ~]# curl -u e7Ll5b67Xv5zZKZBuLLwoOWm:gkZICKnukGLDQmT0PMa1Yp2r11dKL7OmLjiKZFGwMPLRAGrn -XPOST http://127.0.0.1:5001/oauth/token -F grant_type=password -F username=opuser -F password=valid
{"access_token": "MWptz8DVDYYfqYy6inSHq2phkvZZ6fyo8TgDEgEpKK", "expires_in": 864000, "refresh_token": "oQJpPhiTXi10AzfwNfoKQshvE4YosI86FMHY4ban5BzG7JI3", "token_type": "Bearer"}
Failed to get token using "encoded client credentials" [root@server ~]# echo -n 'e7Ll5b67Xv5zZKZBuLLwoOWm:gkZICKnukGLDQmT0PMa1Yp2r11dKL7OmLjiKZFGwMPLRAGrn' | base64 c [root@server ~]# [root@server ~]# curl -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic ZTdMbDViNjdYdjV6WktaQnVMTHdvT1dtOmdrWklDS251a0dMRFFtVDBQTWExWXAycjExZEtMN09tTGppS1pGR3dNUExSQUdybg==" -XPOST http://127.0.0.1:5001/oauth/token -F grant_type=password -F username=opuser -F password=valid {"error": "invalid_grant"}
-----------Updated--------------- Oh, without using '-H "Content-Type: application/x-www-form-urlencoded"', http basic authentication works fine..