Skip to content

OAuth2 Resource Server docs not in sync - authorityPrefix can't be set to "" #8421

@judomu

Description

@judomu

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.

Metadata

Metadata

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions