Skip to content

Commit

Permalink
Remove default priority method impl from SecurityIdentityAugmentor ex…
Browse files Browse the repository at this point in the history
…amples
  • Loading branch information
sberyozkin committed Sep 25, 2020
1 parent bb1e7fd commit db37071
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions docs/src/main/asciidoc/security-customization.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ import java.util.function.Supplier;
@ApplicationScoped
public class RolesAugmentor implements SecurityIdentityAugmentor {
@Override
public int priority() {
return 0;
}
@Override
public Uni<SecurityIdentity> augment(SecurityIdentity identity, AuthenticationRequestContext context) {
return Uni.createFrom().item(build(identity));
Expand Down Expand Up @@ -114,11 +109,6 @@ import java.util.Set;
@ApplicationScoped
public class RolesAugmentor implements SecurityIdentityAugmentor {
@Override
public int priority() {
return 0;
}
@Override
public Uni<SecurityIdentity> augment(SecurityIdentity identity, AuthenticationRequestContext context) {
return Uni.createFrom().item(build(identity));
Expand Down Expand Up @@ -150,6 +140,12 @@ public class RolesAugmentor implements SecurityIdentityAugmentor {
}
----

[NOTE]
===
If more than one custom `SecurityIdentityAugmentor` is registered then they will be considered equal candidates and invoked in random order.
You can enforce the order by implementing a default `SecurityIdentityAugmentor#priority` method. Augmentors with higher priorities will be invoked first.
===

== Custom JAX-RS SecurityContext

If you use JAX-RS `ContainerRequestFilter` to set a custom JAX-RS `SecurityContext` then make sure `ContainerRequestFilter` runs in the JAX-RS pre-match phase by adding a `@PreMatching` annotation to it for this custom security context to be linked with Quarkus `SecurityIdentity`, for example:
Expand Down

0 comments on commit db37071

Please sign in to comment.