In spring-security documentation (https://docs.spring.io/spring-security/site/docs/current/reference/html5/):
Or, you can remove the prefix altogether by calling JwtGrantedAuthoritiesConverter#setAuthorityPrefix("").
But that will not work
public void setAuthorityPrefix(String authorityPrefix) {
Assert.hasText(authorityPrefix, "authorityPrefix cannot be empty");
this.authorityPrefix = authorityPrefix;
}
So the documentation is wrong or the implementation, imho the option to set authorityPrefix to "" makes sense to me.
Comment From: rwinch
Thanks for the report. I think it is the implementation that is broken. Would you like to submit a PR to fix it?
Comment From: judomu
Sure, I will provide the fix
Comment From: rwinch
Thanks @judomu! The issue is yours
Comment From: rwinch
This is now merged into master and 5.2.x