-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 #43938 from sberyozkin/limited_oidc_client_redirect
Support for single same uri redirects for OIDC WebClient
- Loading branch information
Showing
13 changed files
with
391 additions
and
30 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
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
37 changes: 37 additions & 0 deletions
37
...mon/runtime/src/main/java/io/quarkus/oidc/common/runtime/OidcClientRedirectException.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,37 @@ | ||
package io.quarkus.oidc.common.runtime; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@SuppressWarnings("serial") | ||
public class OidcClientRedirectException extends RuntimeException { | ||
|
||
private final String location; | ||
private final List<String> cookies; | ||
|
||
public OidcClientRedirectException(String location, List<String> setCookies) { | ||
this.location = location; | ||
this.cookies = getCookies(setCookies); | ||
} | ||
|
||
private static List<String> getCookies(List<String> setCookies) { | ||
if (setCookies != null && !setCookies.isEmpty()) { | ||
List<String> cookies = new ArrayList<>(); | ||
for (String setCookie : setCookies) { | ||
int index = setCookie.indexOf(";"); | ||
cookies.add(setCookie.substring(0, index)); | ||
} | ||
return cookies; | ||
} | ||
return List.of(); | ||
} | ||
|
||
public String getLocation() { | ||
return location; | ||
} | ||
|
||
public List<String> getCookies() { | ||
return cookies; | ||
} | ||
|
||
} |
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
Oops, something went wrong.