mscb402 commented on issue #8613:
URL: https://github.com/apache/apisix/issues/8613#issuecomment-1371884580
> > Hey @githubxubin, please provide your **complete steps** with APISIX
version :) It's helpful to reproduce your case.
>
> 1.set the public-api:
>
> ```json
> {
> "uri": "/apisix/plugin/jwt/sign",
> "name": "",
> "plugins": {
> "public-api": {}
> },
> "status": 1
> }
> ```
>
> 2.get the token by:/apisix/plugin/jwt/sign i get the token
:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjM1NTIyMTk4NTQsImtleSI6Imp3dF9rZXkifQ.Tr9OvZG_ZadNCWoMqkisQ0u5DagqyArZykl6AgDUnlA
>
> 3.i try to request my interface with the token :
>
http://url?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjM1NTIyMTk4NTQsImtleSI6Imp3dF9rZXkifQ.Tr9OvZG_ZadNCWoMqkisQ0u5DagqyArZykl6AgDUnlA
>
> return:
>
> ```json
> {"message":"failed to verify jwt"}
> ```
>
> What went wrong?
You can't set jwt in request like this way.
You should set jwt token in header `Authorization:`, like this
```
curl http://127.0.0.1:9080/index.html -H 'Authorization:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJ1c2VyLWtleSIsImV4cCI6MTU2NDA1MDgxMX0.Us8zh_4VjJXF-TmR5f8cif8mBU7SuefPlpxhH0jbPVI'
-i
```
There is document you can read
https://apisix.apache.org/docs/apisix/plugins/jwt-auth/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]