Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks spamguy. I figured out a hack to work around the issue and am posting it here for others that may encounter the same problem with the limitations of PowerSchool's OpenID provider.</p> <p>You need to build the request normally with DotNetOpenAuth, then extract the redirect response from the request. Once you have this, you can pull the Location header and overwrite the namespace values as needed.</p> <p>This example is for an MVC application. If you need to do this in a WebForms app, simply take the logic from the method and replace the line <code>return redirectResponse.AsActionResult();</code> with <code>redirectResponse.Send()</code>. You will need to wrap this in the usual try...catch... for ThreadAbortExceptions.</p> <p>namespaces used:</p> <pre><code>using System; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Mvc; using System.Web.Security; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.Extensions.AttributeExchange; using DotNetOpenAuth.OpenId.RelyingParty; </code></pre> <p>hack:</p> <pre><code>const string NS_DCID = "http://powerschool.com/entity/id"; const string NS_USERTYPE = "http://powerschool.com/entity/type"; static readonly OpenIdRelyingParty openid = new OpenIdRelyingParty(); private ActionResult SubmitOpenIdRequest(string openid_identifier) { var request = openid.CreateRequest(openid_identifier); var ax = new FetchRequest(); // any modification to the following attributes will require a corresponding change in the string replacement hack ax.Attributes.AddRequired(NS_DCID); ax.Attributes.AddRequired(NS_USERTYPE); request.AddExtension(ax); var redirectResponse = request.RedirectingResponse; // PowerSchool is violating the attribute exchange specification, requiring specific namespaces and elements to function // Need to overwrite the values generated by OpenID to patch PowerSchool's incorrect provider implementation redirectResponse.Headers["Location"] = redirectResponse.Headers["Location"] .Replace("openid.ns.alias3", "openid.ns.ax") .Replace("openid.alias3.required=dcid%2Calias2", "openid.ax.required=dcid%2Cusertype") .Replace("openid.alias3.mode", "openid.ax.mode") .Replace("openid.alias3.type.alias1", "openid.ax.type.dcid") .Replace("openid.alias3.count.alias1", "openid.ax.count.dcid") .Replace("openid.alias3.type.alias2", "openid.ax.type.usertype") .Replace("openid.alias3.count.alias2", "openid.ax.count.usertype"); return redirectResponse.AsActionResult(); } </code></pre> <p>Be warned: this is a fragile hack. Internal changes in DNOA or changes to the FetchRequest can break the replacement logic.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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