Я использую Onelogin 2.0 toolkit. Вместо входа в систему и ACS в качестве файлов jsp я добавил их в качестве служб отдыха. Я получаю эту ошибку, когда мой IdP перенаправляет на ACS Service Url.SAMLResponse null в адресе запроса ACS: используя инструментарий onelogin
SAML ответ не найден, только поддерживается HTTP_POST Binding
В запросе на ACS параметр службы SAMLResponse приходит утратившим. Как я могу это исправить ?
@Path("/saml")
public class SAMLAuthService {
@Context
HttpServletRequest request;
@Context
HttpServletResponse response;
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/dologin")
public void SAMLLogin(){
try {
Auth auth = new Auth(CommonUtils.samlPropertyFileName,request, response);
System.out.println("Calling SAML Login::");
auth.login();
} catch (Exception e) {
e.printStackTrace();
}
}
@POST
@Produces(MediaType.APPLICATION_JSON)
@Path("/acs")
public Response SAMLACS()
throws ExecException {
Response samlResponse = null;
try {
System.out.println("Calling SAML ACS::");
Auth auth = new Auth(CommonUtils.samlPropertyFileName,request, response);
auth.processResponse();
if (!auth.isAuthenticated()) {
System.out.println("Not Authenticated");
}
List<String> errors = auth.getErrors();
if (!errors.isEmpty()) {
if (auth.isDebugActive()) {
String errorReason = auth.getLastErrorReason();
if (errorReason != null && !errorReason.isEmpty()) {
System.out.println(errorReason);
}
}
} else {
Map<String, List<String>> attributes = auth.getAttributes();
String nameId = auth.getNameId();
System.out.println("NameId::"+nameId);
if (attributes.isEmpty()) {
System.out.println("No Attributes");
}
else {
Collection<String> keys = attributes.keySet();
for(String name :keys){
List<String> values = attributes.get(name);
System.out.println(name+"::");
for(String value :values) {
System.out.print(value);
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return samlResponse;
}
}
SAML Tracer говорит 204 Нет содержимого Ошибка. Я проверил заголовки запросов как для запроса jsp, так и для запроса на отдых. размер заголовка и только URL-адрес различаются – Jerry
Когда вы выполняете поток SAML. Вы видите AuthNRequest, отправленный java-saml в IdP? Почему вам нужно следовать «Заходу на отдых» вместо клонирования того, что работает с приведенными примерами? – smartin
Я не знаком с jsp: | , AuthNRequest отправляется успешно. В любом случае, теперь я делаю это с помощью jsp. – Jerry