Swift и Curl и SAML - PullRequest
       69

Swift и Curl и SAML

0 голосов
/ 13 июля 2020

Я создаю приложение для macOS, которому необходимо войти на сайт Alfresco (управление контентом) с помощью SAML. Я использую Curl и функцию, которая запускает сценарии оболочки для выполнения вызовов. Я новичок в SAML и слежу за этим сайтом, чтобы связать свою программу:

https://www.ssocircle.com/en/developer-tutorial-saml-testing-using-curl-and-ssocheck-api/developer-tutorial-part-i-a-saml-sso-flow-from-the-command-line-with-curl/

Я делаю первый звонок и могу получить 302 редирект. Из этого HTML я могу получить форму отправки и получить URL-адрес, запрос SAML и состояние реле. Я звоню с такими:

curl --header "Content-Type: application/json" -H 'Content-Type: application/x-www-form-urlencoded' -b cookie -c cookie --request POST SAMLResponse="\(strSAMLRequestVal)" --data-urlencode RelayState="\(strSAMLRelayStateVal)" \(strSAMLURL)

, но каждый раз получаю ответ с ошибкой:

<h3>ERROR</h3>
    <p>
       An error occurred while processing your request.  Please contact your helpdesk or
       user ID office for assistance.
    </p>
    <p>
       This service requires cookies. Please ensure cookies are enabled in your browser,
       then go back to your desired resource and try to login again.
    </p>
    <p>
       Use of your browser's back button may cause specific errors that can be resolved by
       going back to your desired resource and trying to login again.
    </p>
    <p>
       If you think you were sent here in error,
       please contact technical support
    </p>       
    
    <strong>Error Message: Error decoding authentication request message</strong>

, так что пара вопросов:

Я собираюсь это правильно? Как я могу хранить данные Cook ie в приложении Swift для macOS? Любая помощь приветствуется.

...