Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Handle incorrect password #5

Description

@nawatts

When attempting to authenticate with an incorrect password, sendIdpRequest fails with:

2016-03-11 17:13:44.120 [Debug] [ECP.swift:67] sendIdpRequest > Error
   Domain=NSXMLParserErrorDomain
   Code=65 "(null)"
   UserInfo={
      NSXMLParserErrorColumn=50,
      NSXMLParserErrorLineNumber=1,
      NSXMLParserErrorMessage=Space required after the Public Identifier
   }
The operation couldn’t be completed. (NSXMLParserErrorDomain error 65.)

It seems AEXML does not parse the response from the IDP in Alamofire+ReactiveCocoa's XMLResponseSerializer. The response from the IDP is:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Authorization Required</title>
</head><body>
<h1>Authorization Required</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<hr>
<address>Apache/2.2.15 (Oracle) Server at idp.clemson.edu Port 443</address>
</body></html>

It seems like the 401 response (assuming the IDP is actually sending 401 as the status code) should be caught and returned as an error with a user friendly message.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions