Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only add value to hash if attr_element hash text #15

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

hermesdt
Copy link

The gem was raising an exception when in the callback there are elements without content, like:

<Element />

In those cases the following is raised:

undefined method `lstrip' for nil:NilClass

Regards.

@kbeckman
Copy link
Owner

Thanks, @hermesdt! Sorry for the delay in getting to this one, but I've been pretty slammed at work and this particular change required me to think about a better overall testing strategy in onmiauth-wsfed. As you probably noticed, all of the XPath parsing in auth_callback.rb is tested using an actual XML file representation from an Azure ACS token... ...and it didn't account for the issue you discovered.

I plan on getting this in over the weekend... I'm working on the testing strategy now so I can better respond to issues like this one in the future.

@kbeckman
Copy link
Owner

@hermestd, I've been working on some refactoring tasks before I merge this in... I'm building in support to handle multiple token types (not just SAML 2.0). See this issue for more details if you're interested.

I have a couple of quick questions about your PR... What token issuer (Azure ACS, ADFS, something else) you were using when it generated an empty <Attribute>? Was it a non-optional claim that just didn't have a value?

If I'm correct, you got something that looked like this with no <AttributeValue>?

<AttributeElement name="http://xmlsoap.org/some/uri/detail" />

And if you don't mind, could you post an example token (complete wresult XML from the callback) to this thread so I can take a look at it? I'd like to be able to compare an authentication from your token issuer with one from Azure ACS just so I can see if there might be some other things similar to the issue you found that might not have popped up yet... Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants