mirror of https://github.com/jacekkow/keycloak-protocol-cas

Hynek Mlnarik
2022-02-18 d99b4efc3399c24e9abea37d1e0d33fa0fc50108
src/main/java/org/keycloak/protocol/cas/utils/RedirectUtils.java
@@ -41,6 +41,12 @@
    private static final Logger logger = Logger.getLogger(RedirectUtils.class);
    /**
     * This method is deprecated for performance and security reasons and it is available just for the
     * backwards compatibility. It is recommended to use some other methods of this class where the client is given as an argument
     * to the method, so we know the client, which redirect-uri we are trying to resolve.
     */
    @Deprecated
    public static String verifyRealmRedirectUri(KeycloakSession session, String redirectUri) {
        Set<String> validRedirects = getValidateRedirectUris(session);
        return verifyRedirectUri(session, null, redirectUri, validRedirects, true);
@@ -71,9 +77,10 @@
        return resolveValidRedirects;
    }
    @Deprecated
    private static Set<String> getValidateRedirectUris(KeycloakSession session) {
        RealmModel realm = session.getContext().getRealm();
        return session.clientStorageManager().getAllRedirectUrisOfEnabledClients(realm).entrySet().stream()
        return session.clients().getAllRedirectUrisOfEnabledClients(realm).entrySet().stream()
          .filter(me -> me.getKey().isEnabled() && OIDCLoginProtocol.LOGIN_PROTOCOL.equals(me.getKey().getProtocol()) && !me.getKey().isBearerOnly() && (me.getKey().isStandardFlowEnabled() || me.getKey().isImplicitFlowEnabled()))
          .map(me -> resolveValidRedirects(session, me.getKey().getRootUrl(), me.getValue()))
          .flatMap(Collection::stream)