Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jwt auth plugin support customize err msg #7095

Closed
malinshadow opened this issue May 21, 2022 · 5 comments · Fixed by #7128
Closed

jwt auth plugin support customize err msg #7095

malinshadow opened this issue May 21, 2022 · 5 comments · Fixed by #7128
Assignees
Labels
enhancement New feature or request

Comments

@malinshadow
Copy link

Description

Right now, we can see if jwt auth failed we can get a error msg {"message":"Missing JWT token in request"}
This tells us we use jwt auth. might be hacker can use the information to do something.
if we can customize the msg will be better to auth security. like consumer restriction plugin, i can use rejected_msg option to change the default msg.

thanks

@juzhiyuan
Copy link
Member

@spacewander
Copy link
Member

"jwt-auth": {
  "_meta": {
    "rejected_msg": {
         "message":"Missing credential in request"
    }
  }
}

We can inject a common _meta with rejected_msg to the plugin.

@tokers
Copy link
Contributor

tokers commented May 23, 2022

"jwt-auth": {
  "_meta": {
    "rejected_msg": {
         "message":"Missing credential in request"
    }
  }
}

We can inject a common _meta with rejected_msg to the plugin.

So other auth plugins can also use the same way.

@tzssangglass
Copy link
Member

"jwt-auth": {
  "_meta": {
    "rejected_msg": {
         "message":"Missing credential in request"
    }
  }
}

We can inject a common _meta with rejected_msg to the plugin.

I'd like to know where this technique is demonstrated, I can't find the relevant code to handle it.

@spacewander
Copy link
Member

"jwt-auth": {
  "_meta": {
    "rejected_msg": {
         "message":"Missing credential in request"
    }
  }
}

We can inject a common _meta with rejected_msg to the plugin.

I'd like to know where this technique is demonstrated, I can't find the relevant code to handle it.

Err. It is just a plan in my mind yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants