Add relay state config in SAML | Community
Skip to main content
Level 3
April 4, 2024
Solved

Add relay state config in SAML

  • April 4, 2024
  • 3 replies
  • 1386 views

Hi,

I need to add relaystate property so should I add property "saml.sp.use.relaystate": true in SAML Authentication Handler configuration file

 

com.adobe.granite.auth.saml.SamlAuthenticationHandler~okta.saml.cfg.json:
......

 "addGroupMemberships": true,
  "defaultGroups": ["administrators"],
  "saml.sp.use.relaystate": true
}


or should i add in


userAuthService.java:
...............................

boolean useRelayState = true;

    @ObjectClassDefinition(name = "dCloud UserAuthService Config", description = "OSGi Service providing UserAuthService config")
    @interface Config {

        @AttributeDefinition(name = "Login Redirection Path", description = "Login Redirection Path")
        String loginRedirectionPath() default "xxx";
        @AttributeDefinition(name = "Forbidden Path", description = "Forbidden Path")
        String forbiddenPath() default "/en/forbidden.html";
        boolean useRelayState() default true;

    }

    @Activate
    protected void activate(Config config) {
        loginRedirectionPath = config.loginRedirectionPath();
        forbiddenPath = config.forbiddenPath();
        useRelayState = config.useRelayState();
    }

let me know which one is correct?


Thanks in advance

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

Hi,

 

It depends on how you want to configure your SAML setup.

Option 1 will limit your configurations to a specific scope. Typically, the OSGi configuration will be associated with a specific RUNMODE and a particular SAML configuration, such as Okta in your case.

On the other hand, Option 2 defaults the configuration for any other SAML implementation. This means that if you add a new SAML configuration, it will inherit the default configuration you've set up.

 

Hope this helps.

 

3 replies

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
April 4, 2024

Hi,

 

It depends on how you want to configure your SAML setup.

Option 1 will limit your configurations to a specific scope. Typically, the OSGi configuration will be associated with a specific RUNMODE and a particular SAML configuration, such as Okta in your case.

On the other hand, Option 2 defaults the configuration for any other SAML implementation. This means that if you add a new SAML configuration, it will inherit the default configuration you've set up.

 

Hope this helps.

 

Esteban Bustamante
arunpatidar
Community Advisor
Community Advisor
April 8, 2024

Hi @tatrived 

Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Arun Patidar
June 28, 2024

I tried to use "saml.sp.use.relaystate"true for relay state redirection but it is not working. Post Authentication the user is landing on the home page of the application despite relay state being present in the URL. Any additional configuration is needed?

New Member
November 19, 2024

Hello,

did you find a solution for this?
Thank you