-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40814 from sberyozkin/oidc_redirect_filter_location
Add Redirect annotation for OidcRedirectFilter
- Loading branch information
Showing
6 changed files
with
132 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/Redirect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package io.quarkus.oidc; | ||
|
||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Annotation that can be used to restrict {@link OidcRedirectFilter} to specific redirect locations | ||
*/ | ||
@Target({ TYPE }) | ||
@Retention(RUNTIME) | ||
public @interface Redirect { | ||
|
||
enum Location { | ||
ALL, | ||
|
||
/** | ||
* Applies to OIDC authorization endpoint | ||
*/ | ||
OIDC_AUTHORIZATION, | ||
|
||
/** | ||
* Applies to OIDC logout endpoint | ||
*/ | ||
OIDC_LOGOUT, | ||
|
||
/** | ||
* Applies to the local redirect to a custom error page resource when an authorization code flow | ||
* redirect from OIDC provider to Quarkus returns an error instead of an authorization code | ||
*/ | ||
ERROR_PAGE, | ||
|
||
/** | ||
* Applies to the local redirect to a custom session expired page resource when | ||
* the current user's session has expired and no longer can be refreshed. | ||
*/ | ||
SESSION_EXPIRED_PAGE, | ||
|
||
/** | ||
* Applies to the local redirect to the callback resource which is done after successful authorization | ||
* code flow completion in order to drop the code and state parameters from the callback URL. | ||
*/ | ||
LOCAL_ENDPOINT_CALLBACK | ||
} | ||
|
||
/** | ||
* Identifies one or more redirect locations. | ||
*/ | ||
Location[] value() default Location.ALL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters