Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Conversation

kevinchalet
Copy link
Contributor

Fixes #295.

@Eilon as promised in my last mail, here are the first bits of the new POST authentication/authorization requests support for OIDC.

/cc @Eilon @HaoK @Tratcher

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="aspnet-contrib" value="https://www.myget.org/F/aspnet-contrib/" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll undo these changes when we're ready to merge this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted.

@Tratcher
Copy link
Member

Forking the comment thread so GitHub will stop hiding it: #392 (comment)
@PinpointTownes, I've forwarded your question to our OIDC spec guy. We'll see what they have to say.

@kevinchalet
Copy link
Contributor Author

@Tratcher thanks!

[sarcastic mode]
I hope your OIDC spec guy will come with a more useful answer than the one he had for response_mode=query because I had the weird impression I was treated like a complete noob last time 😄
[/sarcastic mode]

@@ -4,5 +4,8 @@
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" />
<add key="NuGet" value="https://nuget.org/api/v2/" />
<add key="AzureAD" value="http://www.myget.org/F/azureadwebstacknightly"/>
<add key="aspnet-contrib" value="https://www.myget.org/F/aspnet-contrib/" />
<add key="Roslyn" value="https://www.myget.org/F/roslyn-nightly/" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes have nothing to do in this PR but are required to make CI happy.
I opened a ticket to track this omission (#399) and I'll remove them before squashing.

@kevinchalet
Copy link
Contributor Author

@Tratcher hey. Did you hear back from your OIDC specs specialist?

@Tratcher
Copy link
Member

There is still some debate, but they recommended supporting it.

@kevinchalet
Copy link
Contributor Author

No words about the methods the logout endpoint should support?

#392 (comment)

@Tratcher
Copy link
Member

That's what I meant, they said both endpoint should support POSTs.

@kevinchalet
Copy link
Contributor Author

Ah, interesting. Should we add another property to control the logout method, or should we use AuthenticationMethod for that?

@Tratcher
Copy link
Member

I'd control them both from the same option. I don't know why you'd want to separate them.

@kevinchalet
Copy link
Contributor Author

Well, I guess an authentication server could support POST for the authorization endpoint (since it's mandatory 😄) but not for the end session endpoint.

@kevinchalet
Copy link
Contributor Author

PR rebased and updated to support POST logout requests.

FYI, I'll be absent this week, but I guess this PR is not critical and can wait a bit. I'll react to your feedback next week 👍

@kevinchalet
Copy link
Contributor Author

I'm back! 😄

@blowdart no security concern with this PR?

@kevinchalet kevinchalet changed the title Support POST OpenID Connect authentication requests Support POST OpenID Connect authentication/logout requests Aug 30, 2015

var issuer = Options.HtmlEncoder.HtmlEncode(message.IssuerAddress);

var content = string.Format(CultureInfo.InvariantCulture, HtmlFormFormat, issuer, inputs);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use string interpolation rather than {0}, {1}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we'll have to de-constant-ize (I love that verb 😄) HtmlFormFormat.

See this comment for why I prefer avoiding using string interpolation on .NET 4.5.1 (though it's a great feature): #392 (comment)

@Tratcher
Copy link
Member

:shipit: pending any remaining comments from @blowdart?

@Tratcher Tratcher added this to the 1.0.0-beta8 milestone Aug 31, 2015
@Tratcher Tratcher self-assigned this Aug 31, 2015
@blowdart
Copy link
Member

blowdart commented Sep 1, 2015

Nothing from me.

@Tratcher Tratcher merged commit d9b3ea2 into aspnet:dev Sep 1, 2015
@@ -30,6 +32,22 @@ public class OpenIdConnectAuthenticationHandler : AuthenticationHandler<OpenIdCo
{
private const string NonceProperty = "N";
private const string UriSchemeDelimiter = "://";

private const string InputTagFormat = @"<input type=""hidden"" name=""{0}"" value=""{1}"" />";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blowdart please make sure you review these codez for HTML injection / CSRF / etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did, it's used further down at line 132, with encoding happening in the previous 2 lines.

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

Successfully merging this pull request may close these issues.

6 participants