I've tweaked the OpenIdRelyingPartyWebForms example to work with unsolicited assertions. I now want to turn on
the use of the CustomStore in the example. I did this by uncommenting the <store> element in the OP and RP sites. However, a call is made to CustomStore.GetKey in the RP and I get a
null exception.
So my assumption is that there is no way GetKey in the RP can return a value since it did not make the request in
the first place. Under that assumption, I changed the GetKey implementation in the RP to return null, rather than attempting to create a new CryptoKey, if FindByBucketHandle returned null.
public CryptoKey GetKey(string bucket, string handle) {
var assocRow = dataSet.CryptoKey.FindByBucketHandle(bucket, handle);
if (assocRow == null)
{
return null;
}
return new CryptoKey(assocRow.Secret, assocRow.ExpiresUtc);
}
Making this change, the example runs correctly. Is this a valid implementation of GetKey?
Now that I have enabled the use of the application store through configuration, by what mechanism is is the RP validating the signature of the provider since there are no preconfigured shared secrets in the application store (that I am aware of). Is this done solely in the callback to the provider? If so, how does this prevent something like dns spoofing?
Am I correct in my assumption that if I use the store element in configuration, I do not have to specify the store implementation in the constructor of the OpenIdRelyingParty class?