1
私はEntryPointクラスを以下のように持っていますが、どのような正確な値をrelaystateに設定するかは任意です。認証前に要求されたURLパラメータ値を取得したい。SAMLEntryPointにRelayStateを設定する方法
import org.opensaml.saml2.metadata.provider.MetadataProviderException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.saml.SAMLEntryPoint;
import org.springframework.security.saml.context.SAMLMessageContext;
import org.springframework.security.saml.websso.WebSSOProfileOptions;
public class SamlLoginEntryPoint extends SAMLEntryPoint{
protected WebSSOProfileOptions getProfileOptions(SAMLMessageContext context, AuthenticationException exception) throws MetadataProviderException {
System.out.println("inside entrypoint");
WebSSOProfileOptions ssoProfileOptions;
if (defaultOptions != null) {
System.out.println("in if");
ssoProfileOptions = defaultOptions.clone();
ssoProfileOptions.setRelayState("");
System.out.println("relaystate:"+ssoProfileOptions.getRelayState());
} else {
System.out.println("in else");
ssoProfileOptions = new WebSSOProfileOptions();
ssoProfileOptions.setRelayState("");
}
return ssoProfileOptions;
}