1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.client.ui.commons.resources.saml2sp4ui;
20
21 import org.apache.syncope.client.ui.commons.BaseSession;
22 import org.apache.syncope.client.ui.commons.SAML2SP4UIConstants;
23 import org.apache.syncope.client.ui.commons.annotations.Resource;
24 import org.apache.syncope.common.rest.api.service.SAML2SP4UIService;
25 import org.apache.wicket.Session;
26
27 @Resource(
28 key = SAML2SP4UIConstants.URL_CONTEXT + ".login",
29 path = "/" + SAML2SP4UIConstants.URL_CONTEXT + "/login")
30 public class LoginResource extends AbstractSAML2SP4UIResource {
31
32 private static final long serialVersionUID = 2722386521163557650L;
33
34 @Override
35 protected ResourceResponse newResourceResponse(final Attributes attributes) {
36 String idp = attributes.getRequest().getQueryParameters().
37 getParameterValue(SAML2SP4UIConstants.PARAM_IDP).toString();
38
39 SAML2SP4UIService service = BaseSession.class.cast(Session.get()).getAnonymousService(SAML2SP4UIService.class);
40 return send(service.createLoginRequest(spEntityID(attributes), SAML2SP4UIConstants.URL_CONTEXT, idp));
41 }
42 }