-
Notifications
You must be signed in to change notification settings - Fork 208
/
Startup.Auth.cs
27 lines (25 loc) · 1.06 KB
/
Startup.Auth.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using Microsoft.Identity.Web;
using Microsoft.Identity.Web.OWIN;
using Owin;
namespace OwinWebApi
{
public partial class Startup
{
// For more information on configuring authentication, please visit https://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app)
{
/*
IdentityModelEventSource.Logger.LogLevel = EventLevel.Verbose;
IdentityModelEventSource.ShowPII = true;
var listener = new TextWriterEventListener(@"c:\temp\diag.txt");
listener.EnableEvents(IdentityModelEventSource.Logger, EventLevel.LogAlways);
*/
OwinTokenAcquirerFactory factory = TokenAcquirerFactory.GetDefaultInstance<OwinTokenAcquirerFactory>();
app.AddMicrosoftIdentityWebApi(factory);
factory.Services
.AddMicrosoftGraph()
.AddDownstreamApi("DownstreamAPI", factory.Configuration.GetSection("DownstreamAPI"));
factory.Build();
}
}
}