Note that there are some explanatory texts on larger screens.

plurals
  1. POForcing a different Attribute Exchange namespace in DotNetOpenAuth
    text
    copied!<p>Currently I am using OpenID (via C# and DotNetOpenAuth) to create a single sign-on feature between App A ('their app') and App B ('my app').</p> <p>I wish to make use of attribute exchange to acquire data their app offers. Their API documents how AX requests should look:</p> <pre><code>openid.ns.ax = http://openid.net/srv/ax/1.0 openid.ax.type.studentids = http://theirapp.com/path/student-ids </code></pre> <p>Note the .ax namespace. <a href="http://openid.net/specs/openid-attribute-exchange-1_0.html#fetch_request" rel="nofollow noreferrer">That seems in line with OpenID's AX specs.</a></p> <p>This is how I am using DotNetOpenAuth to request and acquire attributes, <a href="https://stackoverflow.com/a/4451379/260460">as suggested by SO</a> and a gazillion other sources:</p> <pre><code>FetchRequest ax = new FetchRequest(); ax.Attributes.AddRequired("http://theirapp.com/path/student-ids"); request.AddExtension(ax); </code></pre> <p>and</p> <pre><code>string sIDs = String.Empty; if (fetch != null) sIDs = fetch.GetAttributeValue("http://theirapp.com/path/student-ids"); </code></pre> <p>I was confounded when responses came back totally ignoring AX requests. After observing the query string parameters we were sending them, I'm thinking it's actually not their fault:</p> <pre><code>openid.ns:http://specs.openid.net/auth/2.0 openid.ns.alias3:http://openid.net/srv/ax/1.0 openid.alias3.required:alias1 openid.alias3.mode:fetch_request openid.alias3.type.alias1:http://theirapp.com/path/student-ids openid.alias3.count.alias1:1 </code></pre> <p>What the hell, DotNetOpenAuth? Where did 'alias3' come from? That's supposed to be 'ax'. I can't tell if the app I'm working with is overly anal about AX namespaces, or DotNetOpenAuth isn't paying attention to mandatory OpenID protocol.</p> <p>So, after all this build-up, my questions:</p> <ol> <li>I need my AX requests to be in the namespace openid.ax, not openid.alias3. How do I force DotNetOpenAuth to do that?</li> <li>The API requires requested properties be named just so -- in this case, 'student-ids'. Above, they're getting default names like 'alias1'. How do I force DotNetOpenAuth to label properties with custom names?</li> <li>Who's in the right here: the API for requiring openid.ax or DotNetOpenAuth for not caring?</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload