summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-08-29 16:57:20 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2008-08-29 16:57:20 -0700
commit7232aaceb87d34e4538354c840adb46afd07bfc7 (patch)
treeda40c60963c3e4bbcffbef7459d64b8d9f3eb681 /src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs
parente0101d0c3f578b2e12e96c03740102634aa96289 (diff)
downloadDotNetOpenAuth-7232aaceb87d34e4538354c840adb46afd07bfc7.zip
DotNetOpenAuth-7232aaceb87d34e4538354c840adb46afd07bfc7.tar.gz
DotNetOpenAuth-7232aaceb87d34e4538354c840adb46afd07bfc7.tar.bz2
Touching up API and documentation.
Diffstat (limited to 'src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs')
-rw-r--r--src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs b/src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs
index 10a5312..9b007a7 100644
--- a/src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs
+++ b/src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs
@@ -112,7 +112,17 @@ namespace DotNetOpenId.RelyingParty {
get { return new Uri(Util.GetRequiredArg(signedArguments, Provider.Protocol.openid.return_to)); }
}
- internal string GetExtensionClientScript(IClientScriptExtension extension) {
+ internal string GetExtensionClientScript(Type extensionType) {
+ if (extensionType == null) throw new ArgumentNullException("extensionType");
+ if (!typeof(DotNetOpenId.Extensions.IClientScriptExtensionResponse).IsAssignableFrom(extensionType))
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture,
+ Strings.TypeMustImplementX, typeof(IClientScriptExtensionResponse).FullName),
+ "extensionType");
+ var extension = (IClientScriptExtensionResponse)Activator.CreateInstance(extensionType);
+ return GetExtensionClientScript(extension);
+ }
+
+ internal string GetExtensionClientScript(IClientScriptExtensionResponse extension) {
var fields = IncomingExtensions.GetExtensionArguments(extension.TypeUri);
if (fields != null) {
// The extension was found using the preferred TypeUri.