summaryrefslogtreecommitdiffstats
path: root/samples/OAuth2ProtectedWebApi/Code
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-03-02 21:42:03 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2013-03-02 21:42:03 -0800
commit5fe9455f7a2ea615cf98e751179c469ebada9358 (patch)
treee4fa10ebaf57dd26a4f8971e9cf4a8cbcdcb8188 /samples/OAuth2ProtectedWebApi/Code
parent36cadbb1b9bf9c6a9a97b3679f40ea155ce0a615 (diff)
downloadDotNetOpenAuth-5fe9455f7a2ea615cf98e751179c469ebada9358.zip
DotNetOpenAuth-5fe9455f7a2ea615cf98e751179c469ebada9358.tar.gz
DotNetOpenAuth-5fe9455f7a2ea615cf98e751179c469ebada9358.tar.bz2
Fixed up WebAPI sample so it works with anonymous clients.
Diffstat (limited to 'samples/OAuth2ProtectedWebApi/Code')
-rw-r--r--samples/OAuth2ProtectedWebApi/Code/AuthorizationServerHost.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/samples/OAuth2ProtectedWebApi/Code/AuthorizationServerHost.cs b/samples/OAuth2ProtectedWebApi/Code/AuthorizationServerHost.cs
index eb7f3f3..843280b 100644
--- a/samples/OAuth2ProtectedWebApi/Code/AuthorizationServerHost.cs
+++ b/samples/OAuth2ProtectedWebApi/Code/AuthorizationServerHost.cs
@@ -85,7 +85,7 @@
// TODO: Consider adding a clients table in your database to track actual client accounts
// with authenticating secrets.
// For now, just allow all clients regardless of ID, and consider them "Public" clients.
- return new ClientDescription();
+ return new AnyCallbackClient();
}
/// <summary>
@@ -171,5 +171,11 @@
return new AutomatedAuthorizationCheckResponse(accessRequest, false);
}
}
+
+ private class AnyCallbackClient : ClientDescription {
+ public override bool IsCallbackAllowed(Uri callback) {
+ return true;
+ }
+ }
}
} \ No newline at end of file