├── .gitattributes ├── .gitignore ├── LICENSE ├── Practice ├── 01_RoleAndClaim │ ├── Quickstart2_ResourceOwnerPasswords.sln │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ ├── QuickstartIdentityServer │ │ ├── Config.cs │ │ ├── CustomProfileService.cs │ │ ├── CustomResourceOwnerPasswordValidator.cs │ │ ├── Program.cs │ │ ├── QuickstartIdentityServer.csproj │ │ ├── Startup.cs │ │ ├── UserRepository.cs │ │ └── tempkey.rsa │ │ └── ResourceOwnerClient │ │ ├── Program.cs │ │ └── ResourceOwnerClient.csproj ├── 02_AccessTokenLifetime │ ├── Quickstart2_ResourceOwnerPasswords.sln │ ├── readme.md │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ ├── QuickstartIdentityServer │ │ ├── Config.cs │ │ ├── Program.cs │ │ ├── QuickstartIdentityServer.csproj │ │ ├── Startup.cs │ │ └── tempkey.rsa │ │ └── ResourceOwnerClient │ │ ├── Program.cs │ │ └── ResourceOwnerClient.csproj ├── 03_Issuer │ ├── Quickstart.sln │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ ├── IdentityServer │ │ ├── Config.cs │ │ ├── IdentityServer.csproj │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── identityserver4_log.txt │ │ └── tempkey.rsa │ │ └── ResourceOwnerClient │ │ ├── Program.cs │ │ └── ResourceOwnerClient.csproj ├── 04_HTTPS │ ├── Quickstart2_ResourceOwnerPasswords.sln │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ ├── QuickstartIdentityServer │ │ ├── Config.cs │ │ ├── Program.cs │ │ ├── QuickstartIdentityServer.csproj │ │ └── Startup.cs │ │ └── ResourceOwnerClient │ │ ├── Program.cs │ │ └── ResourceOwnerClient.csproj └── 05_Integration │ ├── Quickstart.sln │ ├── readme.md │ └── src │ ├── Api │ ├── Api.csproj │ ├── Controllers │ │ └── IdentityController.cs │ ├── Program.cs │ ├── Startup.cs │ └── appsettings.json │ ├── Client │ ├── Client.csproj │ └── Program.cs │ ├── IdentityServer │ ├── Config.cs │ ├── Controllers │ │ └── IdentityController.cs │ ├── IdentityServer.csproj │ ├── Program.cs │ ├── Startup.cs │ ├── identityserver4_log.txt │ └── tempkey.rsa │ └── ResourceOwnerClient │ ├── Program.cs │ └── ResourceOwnerClient.csproj ├── Quickstarts ├── 1_ClientCredentials │ ├── Quickstart.sln │ ├── readme.md │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ └── IdentityServer │ │ ├── Config.cs │ │ ├── IdentityServer.csproj │ │ ├── Program.cs │ │ └── Startup.cs ├── 2_ResourceOwnerPasswords │ ├── Quickstart.sln │ ├── readme.md │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ ├── IdentityServer │ │ ├── Config.cs │ │ ├── IdentityServer.csproj │ │ ├── Program.cs │ │ └── Startup.cs │ │ └── ResourceOwnerClient │ │ ├── Program.cs │ │ └── ResourceOwnerClient.csproj ├── 3_ImplicitFlowAuthentication │ ├── Quickstart.sln │ ├── readme.md │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ ├── IdentityServer │ │ ├── Config.cs │ │ ├── IdentityServer.csproj │ │ ├── Program.cs │ │ ├── Quickstart │ │ │ ├── Account │ │ │ │ ├── AccountController.cs │ │ │ │ ├── AccountOptions.cs │ │ │ │ ├── ExternalController.cs │ │ │ │ ├── ExternalProvider.cs │ │ │ │ ├── LoggedOutViewModel.cs │ │ │ │ ├── LoginInputModel.cs │ │ │ │ ├── LoginViewModel.cs │ │ │ │ ├── LogoutInputModel.cs │ │ │ │ ├── LogoutViewModel.cs │ │ │ │ └── RedirectViewModel.cs │ │ │ ├── Consent │ │ │ │ ├── ConsentController.cs │ │ │ │ ├── ConsentInputModel.cs │ │ │ │ ├── ConsentOptions.cs │ │ │ │ ├── ConsentViewModel.cs │ │ │ │ ├── ProcessConsentResult.cs │ │ │ │ └── ScopeViewModel.cs │ │ │ ├── Device │ │ │ │ ├── DeviceAuthorizationInputModel.cs │ │ │ │ ├── DeviceAuthorizationViewModel.cs │ │ │ │ └── DeviceController.cs │ │ │ ├── Diagnostics │ │ │ │ ├── DiagnosticsController.cs │ │ │ │ └── DiagnosticsViewModel.cs │ │ │ ├── Extensions.cs │ │ │ ├── Grants │ │ │ │ ├── GrantsController.cs │ │ │ │ └── GrantsViewModel.cs │ │ │ ├── Home │ │ │ │ ├── ErrorViewModel.cs │ │ │ │ └── HomeController.cs │ │ │ ├── SecurityHeadersAttribute.cs │ │ │ └── TestUsers.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Account │ │ │ │ ├── LoggedOut.cshtml │ │ │ │ ├── Login.cshtml │ │ │ │ └── Logout.cshtml │ │ │ ├── Consent │ │ │ │ └── Index.cshtml │ │ │ ├── Device │ │ │ │ ├── Success.cshtml │ │ │ │ ├── UserCodeCapture.cshtml │ │ │ │ └── UserCodeConfirmation.cshtml │ │ │ ├── Diagnostics │ │ │ │ └── Index.cshtml │ │ │ ├── Grants │ │ │ │ └── Index.cshtml │ │ │ ├── Home │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── Redirect.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ ├── _ScopeListItem.cshtml │ │ │ │ └── _ValidationSummary.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ ├── site.less │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── icon.jpg │ │ │ ├── icon.png │ │ │ └── js │ │ │ ├── signin-redirect.js │ │ │ └── signout-redirect.js │ │ ├── MvcClient │ │ ├── .bowerrc │ │ ├── Controllers │ │ │ └── HomeController.cs │ │ ├── MvcClient.csproj │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Home │ │ │ │ ├── Index.cshtml │ │ │ │ └── Secure.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ └── _Layout.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── appsettings.json │ │ ├── bower.json │ │ ├── bundleconfig.json │ │ └── wwwroot │ │ │ ├── _references.js │ │ │ ├── css │ │ │ ├── site.css │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ ├── banner1.svg │ │ │ ├── banner2.svg │ │ │ ├── banner3.svg │ │ │ └── banner4.svg │ │ │ ├── js │ │ │ ├── site.js │ │ │ └── site.min.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── .bower.json │ │ │ ├── LICENSE │ │ │ └── dist │ │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap-theme.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── npm.js │ │ │ ├── jquery-validation-unobtrusive │ │ │ ├── .bower.json │ │ │ ├── jquery.validate.unobtrusive.js │ │ │ └── jquery.validate.unobtrusive.min.js │ │ │ ├── jquery-validation │ │ │ ├── .bower.json │ │ │ ├── LICENSE.md │ │ │ └── dist │ │ │ │ ├── additional-methods.js │ │ │ │ ├── additional-methods.min.js │ │ │ │ ├── jquery.validate.js │ │ │ │ └── jquery.validate.min.js │ │ │ └── jquery │ │ │ ├── .bower.json │ │ │ ├── LICENSE.txt │ │ │ └── dist │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ │ ├── QuickstartIdentityServer │ │ ├── Config.cs │ │ ├── Program.cs │ │ ├── Quickstart │ │ │ ├── Account │ │ │ │ ├── AccountController.cs │ │ │ │ ├── AccountOptions.cs │ │ │ │ ├── ExternalProvider.cs │ │ │ │ ├── LoggedOutViewModel.cs │ │ │ │ ├── LoginInputModel.cs │ │ │ │ ├── LoginViewModel.cs │ │ │ │ ├── LogoutInputModel.cs │ │ │ │ └── LogoutViewModel.cs │ │ │ ├── Consent │ │ │ │ ├── ConsentController.cs │ │ │ │ ├── ConsentInputModel.cs │ │ │ │ ├── ConsentOptions.cs │ │ │ │ ├── ConsentViewModel.cs │ │ │ │ ├── ProcessConsentResult.cs │ │ │ │ └── ScopeViewModel.cs │ │ │ ├── Diagnostics │ │ │ │ ├── DiagnosticsController.cs │ │ │ │ └── DiagnosticsViewModel.cs │ │ │ ├── Grants │ │ │ │ ├── GrantsController.cs │ │ │ │ └── GrantsViewModel.cs │ │ │ ├── Home │ │ │ │ ├── ErrorViewModel.cs │ │ │ │ └── HomeController.cs │ │ │ ├── SecurityHeadersAttribute.cs │ │ │ └── TestUsers.cs │ │ ├── QuickstartIdentityServer.csproj │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Account │ │ │ │ ├── LoggedOut.cshtml │ │ │ │ ├── Login.cshtml │ │ │ │ └── Logout.cshtml │ │ │ ├── Consent │ │ │ │ ├── Index.cshtml │ │ │ │ └── _ScopeListItem.cshtml │ │ │ ├── Diagnostics │ │ │ │ └── Index.cshtml │ │ │ ├── Grants │ │ │ │ └── Index.cshtml │ │ │ ├── Home │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ └── _ValidationSummary.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── updateUI.ps1 │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ ├── site.less │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── icon.jpg │ │ │ ├── icon.png │ │ │ ├── js │ │ │ └── signout-redirect.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ └── bootstrap.min.css │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ └── bootstrap.min.js │ │ │ └── jquery │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ │ └── ResourceOwnerClient │ │ ├── Program.cs │ │ └── ResourceOwnerClient.csproj ├── 4_ImplicitFlowAuthenticationWithExternal │ ├── Quickstart.sln │ ├── readme.md │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ ├── IdentityServer │ │ ├── Config.cs │ │ ├── IdentityServer.csproj │ │ ├── Program.cs │ │ ├── Quickstart │ │ │ ├── Account │ │ │ │ ├── AccountController.cs │ │ │ │ ├── AccountOptions.cs │ │ │ │ ├── ExternalController.cs │ │ │ │ ├── ExternalProvider.cs │ │ │ │ ├── LoggedOutViewModel.cs │ │ │ │ ├── LoginInputModel.cs │ │ │ │ ├── LoginViewModel.cs │ │ │ │ ├── LogoutInputModel.cs │ │ │ │ ├── LogoutViewModel.cs │ │ │ │ └── RedirectViewModel.cs │ │ │ ├── Consent │ │ │ │ ├── ConsentController.cs │ │ │ │ ├── ConsentInputModel.cs │ │ │ │ ├── ConsentOptions.cs │ │ │ │ ├── ConsentViewModel.cs │ │ │ │ ├── ProcessConsentResult.cs │ │ │ │ └── ScopeViewModel.cs │ │ │ ├── Device │ │ │ │ ├── DeviceAuthorizationInputModel.cs │ │ │ │ ├── DeviceAuthorizationViewModel.cs │ │ │ │ └── DeviceController.cs │ │ │ ├── Diagnostics │ │ │ │ ├── DiagnosticsController.cs │ │ │ │ └── DiagnosticsViewModel.cs │ │ │ ├── Extensions.cs │ │ │ ├── Grants │ │ │ │ ├── GrantsController.cs │ │ │ │ └── GrantsViewModel.cs │ │ │ ├── Home │ │ │ │ ├── ErrorViewModel.cs │ │ │ │ └── HomeController.cs │ │ │ ├── SecurityHeadersAttribute.cs │ │ │ └── TestUsers.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Account │ │ │ │ ├── LoggedOut.cshtml │ │ │ │ ├── Login.cshtml │ │ │ │ └── Logout.cshtml │ │ │ ├── Consent │ │ │ │ └── Index.cshtml │ │ │ ├── Device │ │ │ │ ├── Success.cshtml │ │ │ │ ├── UserCodeCapture.cshtml │ │ │ │ └── UserCodeConfirmation.cshtml │ │ │ ├── Diagnostics │ │ │ │ └── Index.cshtml │ │ │ ├── Grants │ │ │ │ └── Index.cshtml │ │ │ ├── Home │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── Redirect.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ ├── _ScopeListItem.cshtml │ │ │ │ └── _ValidationSummary.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── identityserver4_log.txt │ │ ├── tempkey.rsa │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ ├── site.less │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── icon.jpg │ │ │ ├── icon.png │ │ │ └── js │ │ │ ├── signin-redirect.js │ │ │ └── signout-redirect.js │ │ ├── MvcClient │ │ ├── .bowerrc │ │ ├── Controllers │ │ │ └── HomeController.cs │ │ ├── MvcClient.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Home │ │ │ │ ├── Index.cshtml │ │ │ │ └── Secure.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ └── _Layout.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── appsettings.json │ │ ├── bower.json │ │ ├── bundleconfig.json │ │ └── wwwroot │ │ │ ├── _references.js │ │ │ ├── css │ │ │ ├── site.css │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ ├── banner1.svg │ │ │ ├── banner2.svg │ │ │ ├── banner3.svg │ │ │ └── banner4.svg │ │ │ ├── js │ │ │ ├── site.js │ │ │ └── site.min.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── .bower.json │ │ │ ├── LICENSE │ │ │ └── dist │ │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap-theme.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── npm.js │ │ │ ├── jquery-validation-unobtrusive │ │ │ ├── .bower.json │ │ │ ├── jquery.validate.unobtrusive.js │ │ │ └── jquery.validate.unobtrusive.min.js │ │ │ ├── jquery-validation │ │ │ ├── .bower.json │ │ │ ├── LICENSE.md │ │ │ └── dist │ │ │ │ ├── additional-methods.js │ │ │ │ ├── additional-methods.min.js │ │ │ │ ├── jquery.validate.js │ │ │ │ └── jquery.validate.min.js │ │ │ └── jquery │ │ │ ├── .bower.json │ │ │ ├── LICENSE.txt │ │ │ └── dist │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ │ └── ResourceOwnerClient │ │ ├── Program.cs │ │ └── ResourceOwnerClient.csproj ├── 5_HybridFlowAuthenticationWithApiAccess │ ├── Quickstart.sln │ ├── Quickstart5_HybridAndApi.sln │ ├── readme.md │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ ├── IdentityServer │ │ ├── Config.cs │ │ ├── IdentityServer.csproj │ │ ├── Program.cs │ │ ├── Quickstart │ │ │ ├── Account │ │ │ │ ├── AccountController.cs │ │ │ │ ├── AccountOptions.cs │ │ │ │ ├── ExternalController.cs │ │ │ │ ├── ExternalProvider.cs │ │ │ │ ├── LoggedOutViewModel.cs │ │ │ │ ├── LoginInputModel.cs │ │ │ │ ├── LoginViewModel.cs │ │ │ │ ├── LogoutInputModel.cs │ │ │ │ ├── LogoutViewModel.cs │ │ │ │ └── RedirectViewModel.cs │ │ │ ├── Consent │ │ │ │ ├── ConsentController.cs │ │ │ │ ├── ConsentInputModel.cs │ │ │ │ ├── ConsentOptions.cs │ │ │ │ ├── ConsentViewModel.cs │ │ │ │ ├── ProcessConsentResult.cs │ │ │ │ └── ScopeViewModel.cs │ │ │ ├── Device │ │ │ │ ├── DeviceAuthorizationInputModel.cs │ │ │ │ ├── DeviceAuthorizationViewModel.cs │ │ │ │ └── DeviceController.cs │ │ │ ├── Diagnostics │ │ │ │ ├── DiagnosticsController.cs │ │ │ │ └── DiagnosticsViewModel.cs │ │ │ ├── Extensions.cs │ │ │ ├── Grants │ │ │ │ ├── GrantsController.cs │ │ │ │ └── GrantsViewModel.cs │ │ │ ├── Home │ │ │ │ ├── ErrorViewModel.cs │ │ │ │ └── HomeController.cs │ │ │ ├── SecurityHeadersAttribute.cs │ │ │ └── TestUsers.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Account │ │ │ │ ├── LoggedOut.cshtml │ │ │ │ ├── Login.cshtml │ │ │ │ └── Logout.cshtml │ │ │ ├── Consent │ │ │ │ └── Index.cshtml │ │ │ ├── Device │ │ │ │ ├── Success.cshtml │ │ │ │ ├── UserCodeCapture.cshtml │ │ │ │ └── UserCodeConfirmation.cshtml │ │ │ ├── Diagnostics │ │ │ │ └── Index.cshtml │ │ │ ├── Grants │ │ │ │ └── Index.cshtml │ │ │ ├── Home │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── Redirect.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ ├── _ScopeListItem.cshtml │ │ │ │ └── _ValidationSummary.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ ├── site.less │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── icon.jpg │ │ │ ├── icon.png │ │ │ └── js │ │ │ ├── signin-redirect.js │ │ │ └── signout-redirect.js │ │ ├── MvcClient │ │ ├── .bowerrc │ │ ├── Controllers │ │ │ └── HomeController.cs │ │ ├── MvcClient.csproj │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Home │ │ │ │ ├── Index.cshtml │ │ │ │ └── Secure.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── Json.cshtml │ │ │ │ └── _Layout.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── appsettings.json │ │ ├── bower.json │ │ ├── bundleconfig.json │ │ └── wwwroot │ │ │ ├── _references.js │ │ │ ├── css │ │ │ ├── site.css │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ ├── banner1.svg │ │ │ ├── banner2.svg │ │ │ ├── banner3.svg │ │ │ └── banner4.svg │ │ │ ├── js │ │ │ ├── site.js │ │ │ └── site.min.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── .bower.json │ │ │ ├── LICENSE │ │ │ └── dist │ │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap-theme.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── npm.js │ │ │ ├── jquery-validation-unobtrusive │ │ │ ├── .bower.json │ │ │ ├── jquery.validate.unobtrusive.js │ │ │ └── jquery.validate.unobtrusive.min.js │ │ │ ├── jquery-validation │ │ │ ├── .bower.json │ │ │ ├── LICENSE.md │ │ │ └── dist │ │ │ │ ├── additional-methods.js │ │ │ │ ├── additional-methods.min.js │ │ │ │ ├── jquery.validate.js │ │ │ │ └── jquery.validate.min.js │ │ │ └── jquery │ │ │ ├── .bower.json │ │ │ ├── LICENSE.txt │ │ │ └── dist │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ │ ├── QuickstartIdentityServer │ │ ├── Config.cs │ │ ├── Program.cs │ │ ├── Quickstart │ │ │ ├── Account │ │ │ │ ├── AccountController.cs │ │ │ │ ├── AccountOptions.cs │ │ │ │ ├── ExternalProvider.cs │ │ │ │ ├── LoggedOutViewModel.cs │ │ │ │ ├── LoginInputModel.cs │ │ │ │ ├── LoginViewModel.cs │ │ │ │ ├── LogoutInputModel.cs │ │ │ │ └── LogoutViewModel.cs │ │ │ ├── Consent │ │ │ │ ├── ConsentController.cs │ │ │ │ ├── ConsentInputModel.cs │ │ │ │ ├── ConsentOptions.cs │ │ │ │ ├── ConsentViewModel.cs │ │ │ │ ├── ProcessConsentResult.cs │ │ │ │ └── ScopeViewModel.cs │ │ │ ├── Diagnostics │ │ │ │ ├── DiagnosticsController.cs │ │ │ │ └── DiagnosticsViewModel.cs │ │ │ ├── Grants │ │ │ │ ├── GrantsController.cs │ │ │ │ └── GrantsViewModel.cs │ │ │ ├── Home │ │ │ │ ├── ErrorViewModel.cs │ │ │ │ └── HomeController.cs │ │ │ ├── SecurityHeadersAttribute.cs │ │ │ └── TestUsers.cs │ │ ├── QuickstartIdentityServer.csproj │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Account │ │ │ │ ├── LoggedOut.cshtml │ │ │ │ ├── Login.cshtml │ │ │ │ └── Logout.cshtml │ │ │ ├── Consent │ │ │ │ ├── Index.cshtml │ │ │ │ └── _ScopeListItem.cshtml │ │ │ ├── Diagnostics │ │ │ │ └── Index.cshtml │ │ │ ├── Grants │ │ │ │ └── Index.cshtml │ │ │ ├── Home │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ └── _ValidationSummary.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── updateUI.ps1 │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ ├── site.less │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── icon.jpg │ │ │ ├── icon.png │ │ │ ├── js │ │ │ └── signout-redirect.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ └── bootstrap.min.css │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ └── bootstrap.min.js │ │ │ └── jquery │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ │ └── ResourceOwnerClient │ │ ├── Program.cs │ │ └── ResourceOwnerClient.csproj ├── 6_JavaScriptClient │ ├── Quickstart.sln │ ├── readme.md │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ ├── IdentityServer │ │ ├── Config.cs │ │ ├── IdentityServer.csproj │ │ ├── Program.cs │ │ ├── Quickstart │ │ │ ├── Account │ │ │ │ ├── AccountController.cs │ │ │ │ ├── AccountOptions.cs │ │ │ │ ├── ExternalController.cs │ │ │ │ ├── ExternalProvider.cs │ │ │ │ ├── LoggedOutViewModel.cs │ │ │ │ ├── LoginInputModel.cs │ │ │ │ ├── LoginViewModel.cs │ │ │ │ ├── LogoutInputModel.cs │ │ │ │ ├── LogoutViewModel.cs │ │ │ │ └── RedirectViewModel.cs │ │ │ ├── Consent │ │ │ │ ├── ConsentController.cs │ │ │ │ ├── ConsentInputModel.cs │ │ │ │ ├── ConsentOptions.cs │ │ │ │ ├── ConsentViewModel.cs │ │ │ │ ├── ProcessConsentResult.cs │ │ │ │ └── ScopeViewModel.cs │ │ │ ├── Device │ │ │ │ ├── DeviceAuthorizationInputModel.cs │ │ │ │ ├── DeviceAuthorizationViewModel.cs │ │ │ │ └── DeviceController.cs │ │ │ ├── Diagnostics │ │ │ │ ├── DiagnosticsController.cs │ │ │ │ └── DiagnosticsViewModel.cs │ │ │ ├── Extensions.cs │ │ │ ├── Grants │ │ │ │ ├── GrantsController.cs │ │ │ │ └── GrantsViewModel.cs │ │ │ ├── Home │ │ │ │ ├── ErrorViewModel.cs │ │ │ │ └── HomeController.cs │ │ │ ├── SecurityHeadersAttribute.cs │ │ │ └── TestUsers.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Account │ │ │ │ ├── LoggedOut.cshtml │ │ │ │ ├── Login.cshtml │ │ │ │ └── Logout.cshtml │ │ │ ├── Consent │ │ │ │ └── Index.cshtml │ │ │ ├── Device │ │ │ │ ├── Success.cshtml │ │ │ │ ├── UserCodeCapture.cshtml │ │ │ │ └── UserCodeConfirmation.cshtml │ │ │ ├── Diagnostics │ │ │ │ └── Index.cshtml │ │ │ ├── Grants │ │ │ │ └── Index.cshtml │ │ │ ├── Home │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── Redirect.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ ├── _ScopeListItem.cshtml │ │ │ │ └── _ValidationSummary.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ ├── site.less │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── icon.jpg │ │ │ ├── icon.png │ │ │ └── js │ │ │ ├── signin-redirect.js │ │ │ └── signout-redirect.js │ │ ├── JavaScriptClient │ │ ├── JavaScriptClient.csproj │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── app.js │ │ │ ├── callback.html │ │ │ ├── index.html │ │ │ ├── oidc-client.js │ │ │ └── oidc-client.min.js │ │ ├── MvcClient │ │ ├── .bowerrc │ │ ├── Controllers │ │ │ └── HomeController.cs │ │ ├── MvcClient.csproj │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Home │ │ │ │ ├── Index.cshtml │ │ │ │ └── Secure.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── Json.cshtml │ │ │ │ └── _Layout.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── appsettings.json │ │ ├── bower.json │ │ ├── bundleconfig.json │ │ └── wwwroot │ │ │ ├── _references.js │ │ │ ├── css │ │ │ ├── site.css │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ ├── banner1.svg │ │ │ ├── banner2.svg │ │ │ ├── banner3.svg │ │ │ └── banner4.svg │ │ │ └── js │ │ │ ├── site.js │ │ │ └── site.min.js │ │ └── ResourceOwnerClient │ │ ├── Program.cs │ │ └── ResourceOwnerClient.csproj ├── 7_AspNetIdentity │ ├── Quickstart6_AspNetIdentity.sln │ ├── readme.md │ └── src │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── IdentityController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ └── appsettings.json │ │ ├── Client │ │ ├── Client.csproj │ │ └── Program.cs │ │ ├── IdentityServerWithAspNetIdentity │ │ ├── Config.cs │ │ ├── Data │ │ │ ├── ApplicationDbContext.cs │ │ │ └── Migrations │ │ │ │ ├── 20180109192453_CreateIdentitySchema.Designer.cs │ │ │ │ ├── 20180109192453_CreateIdentitySchema.cs │ │ │ │ └── ApplicationDbContextModelSnapshot.cs │ │ ├── IdentityServerWithAspNetIdentity.csproj │ │ ├── Models │ │ │ └── ApplicationUser.cs │ │ ├── Program.cs │ │ ├── Quickstart │ │ │ ├── Account │ │ │ │ ├── AccountController.cs │ │ │ │ ├── AccountOptions.cs │ │ │ │ ├── ExternalProvider.cs │ │ │ │ ├── LoggedOutViewModel.cs │ │ │ │ ├── LoginInputModel.cs │ │ │ │ ├── LoginViewModel.cs │ │ │ │ ├── LogoutInputModel.cs │ │ │ │ └── LogoutViewModel.cs │ │ │ ├── Consent │ │ │ │ ├── ConsentController.cs │ │ │ │ ├── ConsentInputModel.cs │ │ │ │ ├── ConsentOptions.cs │ │ │ │ ├── ConsentViewModel.cs │ │ │ │ ├── ProcessConsentResult.cs │ │ │ │ └── ScopeViewModel.cs │ │ │ ├── Diagnostics │ │ │ │ ├── DiagnosticsController.cs │ │ │ │ └── DiagnosticsViewModel.cs │ │ │ ├── Grants │ │ │ │ ├── GrantsController.cs │ │ │ │ └── GrantsViewModel.cs │ │ │ ├── Home │ │ │ │ ├── ErrorViewModel.cs │ │ │ │ └── HomeController.cs │ │ │ └── SecurityHeadersAttribute.cs │ │ ├── SeedData.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Account │ │ │ │ ├── LoggedOut.cshtml │ │ │ │ ├── Login.cshtml │ │ │ │ └── Logout.cshtml │ │ │ ├── Consent │ │ │ │ ├── Index.cshtml │ │ │ │ └── _ScopeListItem.cshtml │ │ │ ├── Diagnostics │ │ │ │ └── Index.cshtml │ │ │ ├── Grants │ │ │ │ └── Index.cshtml │ │ │ ├── Home │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ └── _ValidationSummary.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ ├── site.less │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── icon.jpg │ │ │ ├── icon.png │ │ │ └── js │ │ │ └── signout-redirect.js │ │ ├── MvcClient │ │ ├── .bowerrc │ │ ├── Controllers │ │ │ └── HomeController.cs │ │ ├── MvcClient.csproj │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Home │ │ │ │ ├── Index.cshtml │ │ │ │ └── Secure.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── Json.cshtml │ │ │ │ └── _Layout.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── appsettings.json │ │ ├── bower.json │ │ ├── bundleconfig.json │ │ └── wwwroot │ │ │ ├── _references.js │ │ │ ├── css │ │ │ ├── site.css │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ ├── banner1.svg │ │ │ ├── banner2.svg │ │ │ ├── banner3.svg │ │ │ └── banner4.svg │ │ │ └── js │ │ │ ├── site.js │ │ │ └── site.min.js │ │ └── ResourceOwnerClient │ │ ├── Program.cs │ │ └── ResourceOwnerClient.csproj └── 8_EntityFrameworkStorage │ ├── Quickstart8_EntityFrameworkStorage.sln │ ├── readme.md │ └── src │ ├── Api │ ├── Api.csproj │ ├── Controllers │ │ └── IdentityController.cs │ ├── Program.cs │ ├── Startup.cs │ └── appsettings.json │ ├── Client │ ├── Client.csproj │ └── Program.cs │ ├── JavaScriptClient │ ├── JavaScriptClient.csproj │ ├── Program.cs │ ├── Startup.cs │ ├── package.json │ └── wwwroot │ │ ├── app.js │ │ ├── callback.html │ │ ├── index.html │ │ └── oidc-client.js │ ├── MvcClient │ ├── .bowerrc │ ├── Controllers │ │ └── HomeController.cs │ ├── MvcClient.csproj │ ├── Program.cs │ ├── Startup.cs │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Secure.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── Json.cshtml │ │ │ └── _Layout.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.json │ ├── bower.json │ ├── bundleconfig.json │ └── wwwroot │ │ ├── _references.js │ │ ├── css │ │ ├── site.css │ │ └── site.min.css │ │ ├── favicon.ico │ │ ├── images │ │ ├── banner1.svg │ │ ├── banner2.svg │ │ ├── banner3.svg │ │ └── banner4.svg │ │ ├── js │ │ ├── site.js │ │ └── site.min.js │ │ └── lib │ │ ├── bootstrap │ │ ├── .bower.json │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-theme.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ │ ├── jquery-validation-unobtrusive │ │ ├── .bower.json │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── .bower.json │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── .bower.json │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map │ ├── QuickstartIdentityServer │ ├── Config.cs │ ├── Data │ │ └── Migrations │ │ │ └── IdentityServer │ │ │ ├── ConfigurationDb │ │ │ ├── 20171005153917_InitialIdentityServerConfigurationDbMigration.Designer.cs │ │ │ ├── 20171005153917_InitialIdentityServerConfigurationDbMigration.cs │ │ │ └── ConfigurationDbContextModelSnapshot.cs │ │ │ └── PersistedGrantDb │ │ │ ├── 20171005153857_InitialIdentityServerPersistedGrantDbMigration.Designer.cs │ │ │ ├── 20171005153857_InitialIdentityServerPersistedGrantDbMigration.cs │ │ │ └── PersistedGrantDbContextModelSnapshot.cs │ ├── Program.cs │ ├── Quickstart │ │ ├── Account │ │ │ ├── AccountController.cs │ │ │ ├── AccountOptions.cs │ │ │ ├── ExternalProvider.cs │ │ │ ├── LoggedOutViewModel.cs │ │ │ ├── LoginInputModel.cs │ │ │ ├── LoginViewModel.cs │ │ │ ├── LogoutInputModel.cs │ │ │ └── LogoutViewModel.cs │ │ ├── Consent │ │ │ ├── ConsentController.cs │ │ │ ├── ConsentInputModel.cs │ │ │ ├── ConsentOptions.cs │ │ │ ├── ConsentViewModel.cs │ │ │ ├── ProcessConsentResult.cs │ │ │ └── ScopeViewModel.cs │ │ ├── Diagnostics │ │ │ ├── DiagnosticsController.cs │ │ │ └── DiagnosticsViewModel.cs │ │ ├── Grants │ │ │ ├── GrantsController.cs │ │ │ └── GrantsViewModel.cs │ │ ├── Home │ │ │ ├── ErrorViewModel.cs │ │ │ └── HomeController.cs │ │ ├── SecurityHeadersAttribute.cs │ │ └── TestUsers.cs │ ├── QuickstartIdentityServer.csproj │ ├── SeedData.cs │ ├── Startup.cs │ ├── Views │ │ ├── Account │ │ │ ├── LoggedOut.cshtml │ │ │ ├── Login.cshtml │ │ │ └── Logout.cshtml │ │ ├── Consent │ │ │ ├── Index.cshtml │ │ │ └── _ScopeListItem.cshtml │ │ ├── Diagnostics │ │ │ └── Index.cshtml │ │ ├── Grants │ │ │ └── Index.cshtml │ │ ├── Home │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _ValidationSummary.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── updateUI.ps1 │ └── wwwroot │ │ ├── css │ │ ├── site.css │ │ ├── site.less │ │ └── site.min.css │ │ ├── favicon.ico │ │ ├── icon.jpg │ │ ├── icon.png │ │ ├── js │ │ └── signout-redirect.js │ │ └── lib │ │ ├── bootstrap │ │ ├── css │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ └── bootstrap.min.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ │ ├── bootstrap.js │ │ │ └── bootstrap.min.js │ │ └── jquery │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map │ └── ResourceOwnerClient │ ├── Program.cs │ └── ResourceOwnerClient.csproj └── README.md /Practice/01_RoleAndClaim/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Practice/01_RoleAndClaim/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Practice/01_RoleAndClaim/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Practice/01_RoleAndClaim/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Practice/01_RoleAndClaim/src/QuickstartIdentityServer/QuickstartIdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Practice/01_RoleAndClaim/src/QuickstartIdentityServer/UserRepository.cs: -------------------------------------------------------------------------------- 1 | namespace QuickstartIdentityServer 2 | { 3 | public class UserRepository 4 | { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /Practice/01_RoleAndClaim/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Practice/02_AccessTokenLifetime/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Practice/02_AccessTokenLifetime/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("[controller]")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | [HttpGet] 15 | public IActionResult Get() 16 | { 17 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Practice/02_AccessTokenLifetime/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Practice/02_AccessTokenLifetime/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Practice/02_AccessTokenLifetime/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Practice/02_AccessTokenLifetime/src/QuickstartIdentityServer/QuickstartIdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Practice/02_AccessTokenLifetime/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Practice/03_Issuer/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Practice/03_Issuer/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.AspNetCore.Mvc.Filters; 8 | 9 | namespace Api.Controllers 10 | { 11 | [Route("identity")] 12 | [Authorize] 13 | public class IdentityController : ControllerBase 14 | { 15 | public IActionResult Get() 16 | { 17 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Practice/03_Issuer/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Practice/03_Issuer/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Practice/03_Issuer/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Practice/03_Issuer/src/IdentityServer/IdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Practice/03_Issuer/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Practice/04_HTTPS/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Practice/04_HTTPS/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("[controller]")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | [HttpGet] 15 | public IActionResult Get() 16 | { 17 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Practice/04_HTTPS/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Practice/04_HTTPS/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Practice/04_HTTPS/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Practice/04_HTTPS/src/QuickstartIdentityServer/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace QuickstartIdentityServer 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "IdentityServer"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Practice/04_HTTPS/src/QuickstartIdentityServer/QuickstartIdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Practice/04_HTTPS/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Practice/05_Integration/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Practice/05_Integration/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("identity")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | public IActionResult Get() 15 | { 16 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Practice/05_Integration/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Practice/05_Integration/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Practice/05_Integration/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Practice/05_Integration/src/IdentityServer/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Mvc; 7 | 8 | namespace IdentityServer.Controllers 9 | { 10 | [Route("identity")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | public IActionResult Get() 15 | { 16 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Practice/05_Integration/src/IdentityServer/IdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Practice/05_Integration/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Quickstarts/1_ClientCredentials/readme.md: -------------------------------------------------------------------------------- 1 | # Quickstart #1: Securing an API using Client Credentials 2 | 3 | The first quickstart sets up a minimal identityserver that shows how to protect an API using the OAuth 2.0 client credentials grant. 4 | This approach is typically used for server to server communication. 5 | 6 | ## Tutorial 7 | 8 | The tutorial that goes along with this sample can be found here [Client Credentials](http://docs.identityserver.io/en/latest/quickstarts/1_client_credentials.html) 9 | 10 | 11 | -------------------------------------------------------------------------------- /Quickstarts/1_ClientCredentials/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Quickstarts/1_ClientCredentials/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("identity")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | public IActionResult Get() 15 | { 16 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Quickstarts/1_ClientCredentials/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Quickstarts/1_ClientCredentials/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/1_ClientCredentials/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/1_ClientCredentials/src/IdentityServer/IdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Quickstarts/2_ResourceOwnerPasswords/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Quickstarts/2_ResourceOwnerPasswords/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("identity")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | public IActionResult Get() 15 | { 16 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Quickstarts/2_ResourceOwnerPasswords/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Quickstarts/2_ResourceOwnerPasswords/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/2_ResourceOwnerPasswords/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/2_ResourceOwnerPasswords/src/IdentityServer/IdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Quickstarts/2_ResourceOwnerPasswords/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/readme.md: -------------------------------------------------------------------------------- 1 | # Quickstart #3: User Authentication using OpenID Connect Implicit Flow 2 | 3 | This quickstart adds support for interactive user authentication using the OpenID Connect implicit flow. 4 | 5 | ## Tutorial 6 | 7 | The tutorial that goes along with this sample can be found here [Adding User Authentication with OpenID Connect](http://docs.identityserver.io/en/latest/quickstarts/3_interactive_login.html) 8 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("identity")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | public IActionResult Get() 15 | { 16 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/IdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServer 8 | { 9 | public class LoginInputModel 10 | { 11 | [Required] 12 | public string Username { get; set; } 13 | [Required] 14 | public string Password { get; set; } 15 | public bool RememberLogin { get; set; } 16 | public string ReturnUrl { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Account/RedirectViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | 6 | namespace IdentityServer 7 | { 8 | public class RedirectViewModel 9 | { 10 | public string RedirectUrl { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServer 8 | { 9 | public class ConsentInputModel 10 | { 11 | public string Button { get; set; } 12 | public IEnumerable ScopesConsented { get; set; } 13 | public bool RememberConsent { get; set; } 14 | public string ReturnUrl { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class ProcessConsentResult 8 | { 9 | public bool IsRedirect => RedirectUri != null; 10 | public string RedirectUri { get; set; } 11 | public string ClientId { get; set; } 12 | 13 | public bool ShowView => ViewModel != null; 14 | public ConsentViewModel ViewModel { get; set; } 15 | 16 | public bool HasValidationError => ValidationError != null; 17 | public string ValidationError { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Name { get; set; } 10 | public string DisplayName { get; set; } 11 | public string Description { get; set; } 12 | public bool Emphasize { get; set; } 13 | public bool Required { get; set; } 14 | public bool Checked { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Device/DeviceAuthorizationInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer.Device 6 | { 7 | public class DeviceAuthorizationInputModel : ConsentInputModel 8 | { 9 | public string UserCode { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Device/DeviceAuthorizationViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer.Device 6 | { 7 | public class DeviceAuthorizationViewModel : ConsentViewModel 8 | { 9 | public string UserCode { get; set; } 10 | public bool ConfirmUserCode { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServer 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorMessage Error { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 | 7 | 8 |
9 |
10 |

Would you like to logout of IdentityServer?

11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Views/Device/Success.cshtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Views/Device/UserCodeCapture.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Views/Diagnostics/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model DiagnosticsViewModel 2 | 3 |

Authentication cookie

4 | 5 |

Claims

6 |
7 | @foreach (var claim in Model.AuthenticateResult.Principal.Claims) 8 | { 9 |
@claim.Type
10 |
@claim.Value
11 | } 12 |
13 | 14 |

Properties

15 |
16 | @foreach (var prop in Model.AuthenticateResult.Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
22 | 23 | @if (Model.Clients.Any()) 24 | { 25 |

Clients

26 |
    27 | @foreach (var client in Model.Clients) 28 | { 29 |
  • @client
  • 30 | } 31 |
32 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Views/Shared/Redirect.cshtml: -------------------------------------------------------------------------------- 1 | @model RedirectViewModel 2 | 3 |

You are now being returned to the application.

4 |

Once complete, you may close this tab

5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/wwwroot/js/signin-redirect.js: -------------------------------------------------------------------------------- 1 | window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); 2 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/IdentityServer/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/MvcClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace MvcClient 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "MVC Client"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

OpenID Connect MVC Client

-------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/Views/Home/Secure.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Authentication 2 | 3 |

Claims

4 | 5 |
6 | @foreach (var claim in User.Claims) 7 | { 8 |
@claim.Type
9 |
@claim.Value
10 | } 11 |
12 | 13 |

Properties

14 | 15 |
16 | @foreach (var prop in (await Context.AuthenticateAsync()).Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
-------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MvcClient 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationInsights": { 3 | "InstrumentationKey": "" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Debug", 9 | "System": "Information", 10 | "Microsoft": "Information" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.6", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optinally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/MvcClient/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class LoginInputModel 10 | { 11 | [Required] 12 | public string Username { get; set; } 13 | [Required] 14 | public string Password { get; set; } 15 | public bool RememberLogin { get; set; } 16 | public string ReturnUrl { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class ConsentInputModel 10 | { 11 | public string Button { get; set; } 12 | public IEnumerable ScopesConsented { get; set; } 13 | public bool RememberConsent { get; set; } 14 | public string ReturnUrl { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Quickstart/Consent/ProcessConsentResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ProcessConsentResult 8 | { 9 | public bool IsRedirect => RedirectUri != null; 10 | public string RedirectUri { get; set; } 11 | 12 | public bool ShowView => ViewModel != null; 13 | public ConsentViewModel ViewModel { get; set; } 14 | 15 | public bool HasValidationError => ValidationError != null; 16 | public string ValidationError { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Name { get; set; } 10 | public string DisplayName { get; set; } 11 | public string Description { get; set; } 12 | public bool Emphasize { get; set; } 13 | public bool Required { get; set; } 14 | public bool Checked { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorMessage Error { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/QuickstartIdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 | 7 | 8 |
9 |
10 |

Would you like to logout of IdentityServer?

11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Views/Diagnostics/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model DiagnosticsViewModel 2 | 3 |

Authentication cookie

4 | 5 |

Claims

6 |
7 | @foreach (var claim in Model.AuthenticateResult.Principal.Claims) 8 | { 9 |
@claim.Type
10 |
@claim.Value
11 | } 12 |
13 | 14 |

Properties

15 |
16 | @foreach (var prop in Model.AuthenticateResult.Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
22 | 23 | @if (Model.Clients.Any()) 24 | { 25 |

Clients

26 |
    27 | @foreach (var client in Model.Clients) 28 | { 29 |
  • @client
  • 30 | } 31 |
32 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer4.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/updateUI.ps1: -------------------------------------------------------------------------------- 1 | iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/IdentityServer/IdentityServer4.Quickstart.UI/release/get.ps1')) -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/3_ImplicitFlowAuthentication/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Quickstarts/3_ImplicitFlowAuthentication/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/readme.md: -------------------------------------------------------------------------------- 1 | # Quickstart #4: Adding external Authentication 2 | 3 | This quickstart adds support for Google authentication. 4 | 5 | ## Tutorial 6 | 7 | The tutorial that goes along with this sample can be found here [Adding Support for External Authentication](http://docs.identityserver.io/en/latest/quickstarts/4_external_authentication.html) 8 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("identity")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | public IActionResult Get() 15 | { 16 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/Api/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5001", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "environmentVariables": { 14 | "ASPNETCORE_ENVIRONMENT": "Development" 15 | } 16 | }, 17 | "Api": { 18 | "commandName": "Project", 19 | "environmentVariables": { 20 | "ASPNETCORE_ENVIRONMENT": "Development" 21 | }, 22 | "applicationUrl": "http://localhost:5001" 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServer 8 | { 9 | public class LoginInputModel 10 | { 11 | [Required] 12 | public string Username { get; set; } 13 | [Required] 14 | public string Password { get; set; } 15 | public bool RememberLogin { get; set; } 16 | public string ReturnUrl { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Quickstart/Account/RedirectViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | 6 | namespace IdentityServer 7 | { 8 | public class RedirectViewModel 9 | { 10 | public string RedirectUrl { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServer 8 | { 9 | public class ConsentInputModel 10 | { 11 | public string Button { get; set; } 12 | public IEnumerable ScopesConsented { get; set; } 13 | public bool RememberConsent { get; set; } 14 | public string ReturnUrl { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Name { get; set; } 10 | public string DisplayName { get; set; } 11 | public string Description { get; set; } 12 | public bool Emphasize { get; set; } 13 | public bool Required { get; set; } 14 | public bool Checked { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Quickstart/Device/DeviceAuthorizationInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer.Device 6 | { 7 | public class DeviceAuthorizationInputModel : ConsentInputModel 8 | { 9 | public string UserCode { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Quickstart/Device/DeviceAuthorizationViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer.Device 6 | { 7 | public class DeviceAuthorizationViewModel : ConsentViewModel 8 | { 9 | public string UserCode { get; set; } 10 | public bool ConfirmUserCode { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServer 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorMessage Error { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 | 7 | 8 |
9 |
10 |

Would you like to logout of IdentityServer?

11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Views/Device/Success.cshtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Views/Device/UserCodeCapture.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Views/Diagnostics/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model DiagnosticsViewModel 2 | 3 |

Authentication cookie

4 | 5 |

Claims

6 |
7 | @foreach (var claim in Model.AuthenticateResult.Principal.Claims) 8 | { 9 |
@claim.Type
10 |
@claim.Value
11 | } 12 |
13 | 14 |

Properties

15 |
16 | @foreach (var prop in Model.AuthenticateResult.Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
22 | 23 | @if (Model.Clients.Any()) 24 | { 25 |

Clients

26 |
    27 | @foreach (var client in Model.Clients) 28 | { 29 |
  • @client
  • 30 | } 31 |
32 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Views/Shared/Redirect.cshtml: -------------------------------------------------------------------------------- 1 | @model RedirectViewModel 2 | 3 |

You are now being returned to the application.

4 |

Once complete, you may close this tab

5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/wwwroot/js/signin-redirect.js: -------------------------------------------------------------------------------- 1 | window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); 2 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/IdentityServer/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/MvcClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

OpenID Connect MVC Client

6 |

点击登录

-------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/Views/Home/Secure.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Authentication 2 | 3 |

Claims

4 | 5 |
6 | @foreach (var claim in User.Claims) 7 | { 8 |
@claim.Type
9 |
@claim.Value
10 | } 11 |
12 | 13 |

Properties

14 | 15 |
16 | @foreach (var prop in (await Context.AuthenticateAsync()).Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
-------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MvcClient 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationInsights": { 3 | "InstrumentationKey": "" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Debug", 9 | "System": "Information", 10 | "Microsoft": "Information" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.6", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optinally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/MvcClient/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /Quickstarts/4_ImplicitFlowAuthenticationWithExternal/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/readme.md: -------------------------------------------------------------------------------- 1 | # Quickstart #5: OpenID Connect Hybrid Flow Authentication and API Access Tokens 2 | 3 | This quickstart we combine what we learned in the previous quickstarts and we explored both API access and user authentication. 4 | 5 | ## Tutorial 6 | 7 | The tutorial that goes along with this sample can be found here [Switching to Hybrid Flow and adding API Access back](http://docs.identityserver.io/en/latest/quickstarts/5_hybrid_and_api_access.html) 8 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("identity")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | public IActionResult Get() 15 | { 16 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/IdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServer 8 | { 9 | public class LoginInputModel 10 | { 11 | [Required] 12 | public string Username { get; set; } 13 | [Required] 14 | public string Password { get; set; } 15 | public bool RememberLogin { get; set; } 16 | public string ReturnUrl { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Quickstart/Account/RedirectViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | 6 | namespace IdentityServer 7 | { 8 | public class RedirectViewModel 9 | { 10 | public string RedirectUrl { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServer 8 | { 9 | public class ConsentInputModel 10 | { 11 | public string Button { get; set; } 12 | public IEnumerable ScopesConsented { get; set; } 13 | public bool RememberConsent { get; set; } 14 | public string ReturnUrl { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Name { get; set; } 10 | public string DisplayName { get; set; } 11 | public string Description { get; set; } 12 | public bool Emphasize { get; set; } 13 | public bool Required { get; set; } 14 | public bool Checked { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Quickstart/Device/DeviceAuthorizationInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer.Device 6 | { 7 | public class DeviceAuthorizationInputModel : ConsentInputModel 8 | { 9 | public string UserCode { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Quickstart/Device/DeviceAuthorizationViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer.Device 6 | { 7 | public class DeviceAuthorizationViewModel : ConsentViewModel 8 | { 9 | public string UserCode { get; set; } 10 | public bool ConfirmUserCode { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServer 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorMessage Error { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 | 7 | 8 |
9 |
10 |

Would you like to logout of IdentityServer?

11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Views/Device/Success.cshtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Views/Device/UserCodeCapture.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Views/Diagnostics/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model DiagnosticsViewModel 2 | 3 |

Authentication cookie

4 | 5 |

Claims

6 |
7 | @foreach (var claim in Model.AuthenticateResult.Principal.Claims) 8 | { 9 |
@claim.Type
10 |
@claim.Value
11 | } 12 |
13 | 14 |

Properties

15 |
16 | @foreach (var prop in Model.AuthenticateResult.Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
22 | 23 | @if (Model.Clients.Any()) 24 | { 25 |

Clients

26 |
    27 | @foreach (var client in Model.Clients) 28 | { 29 |
  • @client
  • 30 | } 31 |
32 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Views/Shared/Redirect.cshtml: -------------------------------------------------------------------------------- 1 | @model RedirectViewModel 2 | 3 |

You are now being returned to the application.

4 |

Once complete, you may close this tab

5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/wwwroot/js/signin-redirect.js: -------------------------------------------------------------------------------- 1 | window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); 2 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/IdentityServer/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/MvcClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | $(IncludeRazorContentInPack) 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

OpenID Connect MVC Client

-------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/Views/Home/Secure.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Authentication 2 | 3 |

Claims

4 | 5 |
6 | @foreach (var claim in User.Claims) 7 | { 8 |
@claim.Type
9 |
@claim.Value
10 | } 11 |
12 | 13 |

Properties

14 | 15 |
16 | @foreach (var prop in (await Context.AuthenticateAsync()).Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
-------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/Views/Shared/Json.cshtml: -------------------------------------------------------------------------------- 1 | 
@ViewBag.Json
-------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MvcClient 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationInsights": { 3 | "InstrumentationKey": "" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Debug", 9 | "System": "Information", 10 | "Microsoft": "Information" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.6", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optinally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/MvcClient/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class LoginInputModel 10 | { 11 | [Required] 12 | public string Username { get; set; } 13 | [Required] 14 | public string Password { get; set; } 15 | public bool RememberLogin { get; set; } 16 | public string ReturnUrl { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class ConsentInputModel 10 | { 11 | public string Button { get; set; } 12 | public IEnumerable ScopesConsented { get; set; } 13 | public bool RememberConsent { get; set; } 14 | public string ReturnUrl { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Quickstart/Consent/ProcessConsentResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ProcessConsentResult 8 | { 9 | public bool IsRedirect => RedirectUri != null; 10 | public string RedirectUri { get; set; } 11 | 12 | public bool ShowView => ViewModel != null; 13 | public ConsentViewModel ViewModel { get; set; } 14 | 15 | public bool HasValidationError => ValidationError != null; 16 | public string ValidationError { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Name { get; set; } 10 | public string DisplayName { get; set; } 11 | public string Description { get; set; } 12 | public bool Emphasize { get; set; } 13 | public bool Required { get; set; } 14 | public bool Checked { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorMessage Error { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/QuickstartIdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 | 7 | 8 |
9 |
10 |

Would you like to logout of IdentityServer?

11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer4.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/updateUI.ps1: -------------------------------------------------------------------------------- 1 | iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/IdentityServer/IdentityServer4.Quickstart.UI/release/get.ps1')) -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Quickstarts/5_HybridFlowAuthenticationWithApiAccess/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/readme.md: -------------------------------------------------------------------------------- 1 | # Quickstart #6: Adding a JavaScript client 2 | 3 | This quickstart will show how to build a browser-based JavaScript client application (sometimes referred to as a “SPA”). 4 | 5 | ## Tutorial 6 | 7 | The tutorial that goes along with this sample can be found here [Adding a JavaScript client](http://docs.identityserver.io/en/latest/quickstarts/6_javascript_client.html) 8 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("identity")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | public IActionResult Get() 15 | { 16 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/IdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServer 8 | { 9 | public class LoginInputModel 10 | { 11 | [Required] 12 | public string Username { get; set; } 13 | [Required] 14 | public string Password { get; set; } 15 | public bool RememberLogin { get; set; } 16 | public string ReturnUrl { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Account/RedirectViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | 6 | namespace IdentityServer 7 | { 8 | public class RedirectViewModel 9 | { 10 | public string RedirectUrl { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServer 8 | { 9 | public class ConsentInputModel 10 | { 11 | public string Button { get; set; } 12 | public IEnumerable ScopesConsented { get; set; } 13 | public bool RememberConsent { get; set; } 14 | public string ReturnUrl { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class ProcessConsentResult 8 | { 9 | public bool IsRedirect => RedirectUri != null; 10 | public string RedirectUri { get; set; } 11 | public string ClientId { get; set; } 12 | 13 | public bool ShowView => ViewModel != null; 14 | public ConsentViewModel ViewModel { get; set; } 15 | 16 | public bool HasValidationError => ValidationError != null; 17 | public string ValidationError { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Name { get; set; } 10 | public string DisplayName { get; set; } 11 | public string Description { get; set; } 12 | public bool Emphasize { get; set; } 13 | public bool Required { get; set; } 14 | public bool Checked { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Device/DeviceAuthorizationInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer.Device 6 | { 7 | public class DeviceAuthorizationInputModel : ConsentInputModel 8 | { 9 | public string UserCode { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Device/DeviceAuthorizationViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer.Device 6 | { 7 | public class DeviceAuthorizationViewModel : ConsentViewModel 8 | { 9 | public string UserCode { get; set; } 10 | public bool ConfirmUserCode { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServer 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorMessage Error { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 | 7 | 8 |
9 |
10 |

Would you like to logout of IdentityServer?

11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Views/Device/Success.cshtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Views/Device/UserCodeCapture.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Views/Diagnostics/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model DiagnosticsViewModel 2 | 3 |

Authentication cookie

4 | 5 |

Claims

6 |
7 | @foreach (var claim in Model.AuthenticateResult.Principal.Claims) 8 | { 9 |
@claim.Type
10 |
@claim.Value
11 | } 12 |
13 | 14 |

Properties

15 |
16 | @foreach (var prop in Model.AuthenticateResult.Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
22 | 23 | @if (Model.Clients.Any()) 24 | { 25 |

Clients

26 |
    27 | @foreach (var client in Model.Clients) 28 | { 29 |
  • @client
  • 30 | } 31 |
32 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Views/Shared/Redirect.cshtml: -------------------------------------------------------------------------------- 1 | @model RedirectViewModel 2 | 3 |

You are now being returned to the application.

4 |

Once complete, you may close this tab

5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/6_JavaScriptClient/src/IdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/6_JavaScriptClient/src/IdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/6_JavaScriptClient/src/IdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/wwwroot/js/signin-redirect.js: -------------------------------------------------------------------------------- 1 | window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); 2 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/IdentityServer/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/JavaScriptClient/JavaScriptClient.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/JavaScriptClient/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace JavaScriptClient 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/JavaScriptClient/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace JavaScriptClient 5 | { 6 | public class Startup 7 | { 8 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 9 | { 10 | app.UseDefaultFiles(); 11 | app.UseStaticFiles(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/JavaScriptClient/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/JavaScriptClient/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/JavaScriptClient/wwwroot/callback.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/JavaScriptClient/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

13 | 
14 |     
15 |     
16 | 
17 | 


--------------------------------------------------------------------------------
/Quickstarts/6_JavaScriptClient/src/MvcClient/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 |   "directory": "wwwroot/lib"
3 | }
4 | 


--------------------------------------------------------------------------------
/Quickstarts/6_JavaScriptClient/src/MvcClient/MvcClient.csproj:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |   
 4 |     netcoreapp2.1
 5 |   
 6 | 
 7 |   
 8 |     
 9 |   
10 | 
11 |   
12 |     
13 |       $(IncludeRazorContentInPack)
14 |     
15 |   
16 |   
17 | 


--------------------------------------------------------------------------------
/Quickstarts/6_JavaScriptClient/src/MvcClient/Program.cs:
--------------------------------------------------------------------------------
 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
 3 | 
 4 | using System;
 5 | using Microsoft.AspNetCore;
 6 | using Microsoft.AspNetCore.Hosting;
 7 | 
 8 | namespace MvcClient
 9 | {
10 |     public class Program
11 |     {
12 |         public static void Main(string[] args)
13 |         {
14 |             Console.Title = "MVC Client";
15 | 
16 |             BuildWebHost(args).Run();
17 |         }
18 | 
19 |         public static IWebHost BuildWebHost(string[] args) =>
20 |             WebHost.CreateDefaultBuilder(args)
21 |                 .UseStartup()
22 |                 .Build();
23 |     }
24 | }


--------------------------------------------------------------------------------
/Quickstarts/6_JavaScriptClient/src/MvcClient/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 |     ViewData["Title"] = "Home Page";
3 | }
4 | 
5 | 

OpenID Connect MVC Client

-------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/Views/Home/Secure.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Authentication 2 | 3 |

Claims

4 | 5 |
6 | @foreach (var claim in User.Claims) 7 | { 8 |
@claim.Type
9 |
@claim.Value
10 | } 11 |
12 | 13 |

Properties

14 | 15 |
16 | @foreach (var prop in (await Context.AuthenticateAsync()).Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
-------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/Views/Shared/Json.cshtml: -------------------------------------------------------------------------------- 1 | 
@ViewBag.Json
-------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MvcClient 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationInsights": { 3 | "InstrumentationKey": "" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Debug", 9 | "System": "Information", 10 | "Microsoft": "Information" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.6", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optinally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/6_JavaScriptClient/src/MvcClient/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/MvcClient/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/6_JavaScriptClient/src/MvcClient/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /Quickstarts/6_JavaScriptClient/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | latest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/readme.md: -------------------------------------------------------------------------------- 1 | # Quickstart #6: IdentityServer and ASP.NET Identity 2 | 3 | This quickstart uses ASP.NET Identity for identity management. 4 | 5 | ## Tutorial 6 | 7 | The tutorial that goes along with this sample can be found here [Using ASP.NET Core Identity](http://docs.identityserver.io/en/release/quickstarts/6_aspnet_identity.html) 8 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("[controller]")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | [HttpGet] 15 | public IActionResult Get() 16 | { 17 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Models/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Identity; 6 | 7 | namespace IdentityServerWithAspNetIdentity.Models 8 | { 9 | // Add profile data for application users by adding properties to the ApplicationUser class 10 | public class ApplicationUser : IdentityUser 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class LoginInputModel 10 | { 11 | [Required] 12 | public string Username { get; set; } 13 | [Required] 14 | public string Password { get; set; } 15 | public bool RememberLogin { get; set; } 16 | public string ReturnUrl { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class ConsentInputModel 10 | { 11 | public string Button { get; set; } 12 | public IEnumerable ScopesConsented { get; set; } 13 | public bool RememberConsent { get; set; } 14 | public string ReturnUrl { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Quickstart/Consent/ProcessConsentResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ProcessConsentResult 8 | { 9 | public bool IsRedirect => RedirectUri != null; 10 | public string RedirectUri { get; set; } 11 | 12 | public bool ShowView => ViewModel != null; 13 | public ConsentViewModel ViewModel { get; set; } 14 | 15 | public bool HasValidationError => ValidationError != null; 16 | public string ValidationError { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Name { get; set; } 10 | public string DisplayName { get; set; } 11 | public string Description { get; set; } 12 | public bool Emphasize { get; set; } 13 | public bool Required { get; set; } 14 | public bool Checked { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorMessage Error { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 | 7 | 8 |
9 |
10 |

Would you like to logout of IdentityServer?

11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Views/Diagnostics/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model DiagnosticsViewModel 2 | 3 |

Authentication cookie

4 | 5 |

Claims

6 |
7 | @foreach (var claim in Model.AuthenticateResult.Principal.Claims) 8 | { 9 |
@claim.Type
10 |
@claim.Value
11 | } 12 |
13 | 14 |

Properties

15 |
16 | @foreach (var prop in Model.AuthenticateResult.Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
22 | 23 | @if (Model.Clients.Any()) 24 | { 25 |

Clients

26 |
    27 | @foreach (var client in Model.Clients) 28 | { 29 |
  • @client
  • 30 | } 31 |
32 | } -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer4.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "Data Source=AspIdUsers.db;" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/wwwroot/icon.jpg -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/wwwroot/icon.png -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/IdentityServerWithAspNetIdentity/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/MvcClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace MvcClient 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "MVC Client"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

OpenID Connect MVC Client

-------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/Views/Shared/Json.cshtml: -------------------------------------------------------------------------------- 1 | 

API response

2 | 3 |
@ViewBag.Json
-------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MvcClient 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationInsights": { 3 | "InstrumentationKey": "" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Debug", 9 | "System": "Information", 10 | "Microsoft": "Information" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.6", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optinally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/7_AspNetIdentity/src/MvcClient/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/MvcClient/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/7_AspNetIdentity/src/MvcClient/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /Quickstarts/7_AspNetIdentity/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/readme.md: -------------------------------------------------------------------------------- 1 | # Quickstart #8: EntityFramework configuration 2 | 3 | This quickstart shows how to use EntityFramework for the configuration data. 4 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/Api/Controllers/IdentityController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System.Linq; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Authorization; 7 | 8 | namespace Api.Controllers 9 | { 10 | [Route("[controller]")] 11 | [Authorize] 12 | public class IdentityController : ControllerBase 13 | { 14 | [HttpGet] 15 | public IActionResult Get() 16 | { 17 | return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/Api/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.AspNetCore; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace Api 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | Console.Title = "API"; 15 | 16 | BuildWebHost(args).Run(); 17 | } 18 | 19 | public static IWebHost BuildWebHost(string[] args) => 20 | WebHost.CreateDefaultBuilder(args) 21 | .UseStartup() 22 | .Build(); 23 | } 24 | } -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/JavaScriptClient/JavaScriptClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/JavaScriptClient/Startup.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | using Microsoft.AspNetCore.Builder; 5 | using Microsoft.Extensions.DependencyInjection; 6 | 7 | namespace JavaScriptClient 8 | { 9 | public class Startup 10 | { 11 | public void ConfigureServices(IServiceCollection services) 12 | { 13 | } 14 | 15 | public void Configure(IApplicationBuilder app) 16 | { 17 | app.UseDefaultFiles(); 18 | app.UseStaticFiles(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/JavaScriptClient/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "asp.net", 4 | "private": true, 5 | "devDependencies": { 6 | "oidc-client": "1.2.2" 7 | } 8 | } -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/JavaScriptClient/wwwroot/callback.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/JavaScriptClient/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

13 | 
14 |     
15 |     
16 | 
17 | 


--------------------------------------------------------------------------------
/Quickstarts/8_EntityFrameworkStorage/src/MvcClient/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 |   "directory": "wwwroot/lib"
3 | }
4 | 


--------------------------------------------------------------------------------
/Quickstarts/8_EntityFrameworkStorage/src/MvcClient/MvcClient.csproj:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |   
 4 |     netcoreapp2.0
 5 |   
 6 | 
 7 |   
 8 |     
 9 |     
10 |   
11 | 
12 |   
13 |     
14 |   
15 | 
16 | 
17 | 


--------------------------------------------------------------------------------
/Quickstarts/8_EntityFrameworkStorage/src/MvcClient/Program.cs:
--------------------------------------------------------------------------------
 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
 3 | 
 4 | using System;
 5 | using Microsoft.AspNetCore;
 6 | using Microsoft.AspNetCore.Hosting;
 7 | 
 8 | namespace MvcClient
 9 | {
10 |     public class Program
11 |     {
12 |         public static void Main(string[] args)
13 |         {
14 |             Console.Title = "MVC Client";
15 | 
16 |             BuildWebHost(args).Run();
17 |         }
18 | 
19 |         public static IWebHost BuildWebHost(string[] args) =>
20 |             WebHost.CreateDefaultBuilder(args)
21 |                 .UseStartup()
22 |                 .Build();
23 |     }
24 | }


--------------------------------------------------------------------------------
/Quickstarts/8_EntityFrameworkStorage/src/MvcClient/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 |     ViewData["Title"] = "Home Page";
3 | }
4 | 
5 | 

OpenID Connect MVC Client

-------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/Views/Shared/Json.cshtml: -------------------------------------------------------------------------------- 1 | 

API response

2 | 3 |
@ViewBag.Json
-------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MvcClient 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationInsights": { 3 | "InstrumentationKey": "" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Debug", 9 | "System": "Information", 10 | "Microsoft": "Information" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.6", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optinally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/MvcClient/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class LoginInputModel 10 | { 11 | [Required] 12 | public string Username { get; set; } 13 | [Required] 14 | public string Password { get; set; } 15 | public bool RememberLogin { get; set; } 16 | public string ReturnUrl { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class ConsentInputModel 10 | { 11 | public string Button { get; set; } 12 | public IEnumerable ScopesConsented { get; set; } 13 | public bool RememberConsent { get; set; } 14 | public string ReturnUrl { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Quickstart/Consent/ProcessConsentResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ProcessConsentResult 8 | { 9 | public bool IsRedirect => RedirectUri != null; 10 | public string RedirectUri { get; set; } 11 | 12 | public bool ShowView => ViewModel != null; 13 | public ConsentViewModel ViewModel { get; set; } 14 | 15 | public bool HasValidationError => ValidationError != null; 16 | public string ValidationError { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Name { get; set; } 10 | public string DisplayName { get; set; } 11 | public string Description { get; set; } 12 | public bool Emphasize { get; set; } 13 | public bool Required { get; set; } 14 | public bool Checked { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorMessage Error { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/QuickstartIdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 | 7 | 8 |
9 |
10 |

Would you like to logout of IdentityServer?

11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Views/Diagnostics/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model DiagnosticsViewModel 2 | 3 |

Authentication cookie

4 | 5 |

Claims

6 |
7 | @foreach (var claim in Model.AuthenticateResult.Principal.Claims) 8 | { 9 |
@claim.Type
10 |
@claim.Value
11 | } 12 |
13 | 14 |

Properties

15 |
16 | @foreach (var prop in Model.AuthenticateResult.Properties.Items) 17 | { 18 |
@prop.Key
19 |
@prop.Value
20 | } 21 |
22 | 23 | @if (Model.Clients.Any()) 24 | { 25 |

Clients

26 |
    27 | @foreach (var client in Model.Clients) 28 | { 29 |
  • @client
  • 30 | } 31 |
32 | } -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer4.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/updateUI.ps1: -------------------------------------------------------------------------------- 1 | iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/IdentityServer/IdentityServer4.Quickstart.UI/release/get.ps1')) -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stulzq/IdentityServer4.Samples/410a627d363aae9e7791c4d399d8aa1d89981a5c/Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Quickstarts/8_EntityFrameworkStorage/src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | --------------------------------------------------------------------------------