summaryrefslogtreecommitdiffstats
path: root/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/App_Start/Startup.Auth.cs
diff options
context:
space:
mode:
authorDavid Christiansen <coding@davedoes.net>2015-01-05 21:29:48 +0000
committerDavid Christiansen <coding@davedoes.net>2015-01-05 21:29:48 +0000
commit5fde84cfe2967d203c8bc183708394d95bb52c36 (patch)
treeb082a01743f2d20ce80dddcc4a99f88f0c49e1c4 /samples/DotNetOpenAuth.Samples.OpenIDConnectRP/App_Start/Startup.Auth.cs
parentf840b593c345265ebcfd6c1cf5b57ab6d948f92c (diff)
downloadDotNetOpenAuth-5fde84cfe2967d203c8bc183708394d95bb52c36.zip
DotNetOpenAuth-5fde84cfe2967d203c8bc183708394d95bb52c36.tar.gz
DotNetOpenAuth-5fde84cfe2967d203c8bc183708394d95bb52c36.tar.bz2
Straight forward OpenID Connect RP example
Diffstat (limited to 'samples/DotNetOpenAuth.Samples.OpenIDConnectRP/App_Start/Startup.Auth.cs')
-rw-r--r--samples/DotNetOpenAuth.Samples.OpenIDConnectRP/App_Start/Startup.Auth.cs39
1 files changed, 39 insertions, 0 deletions
diff --git a/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/App_Start/Startup.Auth.cs b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/App_Start/Startup.Auth.cs
new file mode 100644
index 0000000..59d7fc6
--- /dev/null
+++ b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/App_Start/Startup.Auth.cs
@@ -0,0 +1,39 @@
+using System;
+using Microsoft.AspNet.Identity;
+using Microsoft.AspNet.Identity.Owin;
+using Microsoft.Owin;
+using Microsoft.Owin.Security.Cookies;
+using Microsoft.Owin.Security.OpenIdConnect;
+using Owin;
+using DotNetOpenAuth.Samples.OpenIDConnectRP.Models;
+
+namespace DotNetOpenAuth.Samples.OpenIDConnectRP
+{
+ using System.Collections.Generic;
+ using System.IdentityModel.Claims;
+ using System.IdentityModel.Tokens;
+ using System.Web.Helpers;
+
+ public partial class Startup
+ {
+ public void ConfigureAuth(IAppBuilder app)
+ {
+ JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>();
+ app.UseCookieAuthentication(new CookieAuthenticationOptions
+ {
+ AuthenticationType = "Cookies"
+ });
+ app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions {
+ ClientId = "DNOA",
+ Authority = "https://localhost:44333/core",
+ RedirectUri = "http://localhost:39743/",
+ ResponseType = "id_token",
+ Scope = "openid email",
+
+ SignInAsAuthenticationType = "Cookies",
+
+ });
+ AntiForgeryConfig.UniqueClaimTypeIdentifier = "sub";
+ }
+ }
+} \ No newline at end of file