Skip to content

Commit 0b7eff0

Browse files
committed
UY-1115 set return option id from auto-proxy login handler
1 parent 137d8ea commit 0b7eff0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

oauth/src/main/java/pl/edu/icm/unity/oauth/client/web/OAuthProxyAuthnHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
package pl.edu.icm.unity.oauth.client.web;
66

7+
import static pl.edu.icm.unity.engine.api.authn.remote.RemoteAuthnState.CURRENT_REMOTE_AUTHN_OPTION_SESSION_ATTRIBUTE;
8+
79
import java.io.IOException;
810
import java.util.Optional;
911
import java.util.Set;
@@ -95,6 +97,8 @@ private boolean startLogin(String idpConfigKey, HttpServletRequest httpRequest,
9597
context.setReturnUrl(currentRelativeURI);
9698
session.setAttribute(OAuth2Retrieval.REMOTE_AUTHN_CONTEXT, context);
9799
session.setAttribute(ProxyAuthenticationFilter.AUTOMATED_LOGIN_FIRED, "true");
100+
session.setAttribute(CURRENT_REMOTE_AUTHN_OPTION_SESSION_ATTRIBUTE,
101+
context.getAuthenticatorOptionId());
98102
} catch (Exception e)
99103
{
100104
throw new IllegalStateException("Can not create OAuth2 authN request", e);

saml/src/main/java/pl/edu/icm/unity/saml/sp/web/SAMLProxyAuthnHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
package pl.edu.icm.unity.saml.sp.web;
66

7+
import static pl.edu.icm.unity.engine.api.authn.remote.RemoteAuthnState.CURRENT_REMOTE_AUTHN_OPTION_SESSION_ATTRIBUTE;
8+
79
import java.io.IOException;
810
import java.util.Optional;
911
import java.util.Set;
@@ -102,6 +104,8 @@ private boolean startLogin(String idpConfigKey, HttpServletRequest httpRequest,
102104
getAuthnOptionId(idpConfigKey));
103105
session.setAttribute(SAMLRetrieval.REMOTE_AUTHN_CONTEXT, context);
104106
session.setAttribute(ProxyAuthenticationFilter.AUTOMATED_LOGIN_FIRED, "true");
107+
session.setAttribute(CURRENT_REMOTE_AUTHN_OPTION_SESSION_ATTRIBUTE,
108+
context.getAuthenticatorOptionId());
105109
samlContextManagement.addAuthnContext(context);
106110
} catch (Exception e)
107111
{

0 commit comments

Comments
 (0)