├── .vs ├── Quickstart7_JavaScriptClient_CallPythonApi │ └── v15 │ │ ├── .suo │ │ └── Server │ │ └── sqlite3 │ │ ├── db.lock │ │ └── storage.ide └── config │ └── applicationhost.config ├── Quickstart7_JavaScriptClient_CallPythonApi.sln ├── readme.md └── src ├── Client ├── Client.csproj ├── Program.cs ├── bin │ └── Debug │ │ └── netcoreapp2.0 │ │ ├── Client.deps.json │ │ ├── Client.dll │ │ ├── Client.pdb │ │ ├── Client.runtimeconfig.dev.json │ │ └── Client.runtimeconfig.json └── obj │ ├── Client.csproj.nuget.cache │ ├── Client.csproj.nuget.g.props │ ├── Client.csproj.nuget.g.targets │ ├── Debug │ └── netcoreapp2.0 │ │ ├── Client.AssemblyInfo.cs │ │ ├── Client.AssemblyInfoInputs.cache │ │ ├── Client.csproj.CoreCompileInputs.cache │ │ ├── Client.csproj.FileListAbsolute.txt │ │ ├── Client.csprojResolveAssemblyReference.cache │ │ ├── Client.dll │ │ └── Client.pdb │ └── project.assets.json ├── JavaScriptClient ├── JavaScriptClient.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── bin │ └── Debug │ │ └── netcoreapp2.0 │ │ ├── JavaScriptClient.deps.json │ │ ├── JavaScriptClient.dll │ │ ├── JavaScriptClient.pdb │ │ ├── JavaScriptClient.runtimeconfig.dev.json │ │ └── JavaScriptClient.runtimeconfig.json ├── node_modules │ ├── jsrsasign │ │ ├── Makefile │ │ ├── README.md │ │ ├── lib │ │ │ ├── footer.js │ │ │ ├── header.js │ │ │ ├── jsrsasign.js │ │ │ └── lib.js │ │ └── package.json │ └── oidc-client │ │ ├── .babelrc │ │ ├── .gitattributes │ │ ├── .npmignore │ │ ├── GitReleaseManager.yaml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bower.json │ │ ├── dist │ │ ├── oidc-client.js │ │ └── oidc-client.min.js │ │ ├── gulpfile.js │ │ ├── index.js │ │ ├── jsconfig.json │ │ ├── lib │ │ ├── oidc-client.js │ │ └── oidc-client.min.js │ │ ├── oidc-client.d.ts │ │ ├── package.json │ │ ├── src │ │ ├── AccessTokenEvents.js │ │ ├── CheckSessionIFrame.js │ │ ├── CordovaIFrameNavigator.js │ │ ├── CordovaPopupNavigator.js │ │ ├── CordovaPopupWindow.js │ │ ├── ErrorResponse.js │ │ ├── Event.js │ │ ├── Global.js │ │ ├── IFrameNavigator.js │ │ ├── IFrameWindow.js │ │ ├── InMemoryWebStorage.js │ │ ├── JoseUtil.js │ │ ├── JsonService.js │ │ ├── Log.js │ │ ├── MetadataService.js │ │ ├── OidcClient.js │ │ ├── OidcClientSettings.js │ │ ├── PopupNavigator.js │ │ ├── PopupWindow.js │ │ ├── RedirectNavigator.js │ │ ├── ResponseValidator.js │ │ ├── SessionMonitor.js │ │ ├── SigninRequest.js │ │ ├── SigninResponse.js │ │ ├── SigninState.js │ │ ├── SignoutRequest.js │ │ ├── SignoutResponse.js │ │ ├── SilentRenewService.js │ │ ├── State.js │ │ ├── Timer.js │ │ ├── TokenRevocationClient.js │ │ ├── UrlUtility.js │ │ ├── User.js │ │ ├── UserInfoService.js │ │ ├── UserManager.js │ │ ├── UserManagerEvents.js │ │ ├── UserManagerSettings.js │ │ ├── WebStorageStateStore.js │ │ └── random.js │ │ └── webpack.base.js ├── obj │ ├── Debug │ │ └── netcoreapp2.0 │ │ │ ├── JavaScriptClient.AssemblyInfo.cs │ │ │ ├── JavaScriptClient.AssemblyInfoInputs.cache │ │ │ ├── JavaScriptClient.csproj.CoreCompileInputs.cache │ │ │ ├── JavaScriptClient.csproj.FileListAbsolute.txt │ │ │ ├── JavaScriptClient.csprojResolveAssemblyReference.cache │ │ │ ├── JavaScriptClient.dll │ │ │ └── JavaScriptClient.pdb │ ├── JavaScriptClient.csproj.nuget.cache │ ├── JavaScriptClient.csproj.nuget.g.props │ ├── JavaScriptClient.csproj.nuget.g.targets │ └── project.assets.json ├── package.json └── wwwroot │ ├── app.js │ ├── callback.html │ ├── index.html │ ├── oidc-client.js │ └── oidc-client.min.js ├── MvcClient ├── .bowerrc ├── Controllers │ └── HomeController.cs ├── MvcClient.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ └── Secure.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── Json.cshtml │ │ └── _Layout.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── appsettings.json ├── bin │ └── Debug │ │ └── netcoreapp2.0 │ │ ├── MvcClient.deps.json │ │ ├── MvcClient.dll │ │ ├── MvcClient.pdb │ │ ├── MvcClient.runtimeconfig.dev.json │ │ └── MvcClient.runtimeconfig.json ├── bower.json ├── bundleconfig.json ├── obj │ ├── Debug │ │ └── netcoreapp2.0 │ │ │ ├── MvcClient.AssemblyInfo.cs │ │ │ ├── MvcClient.AssemblyInfoInputs.cache │ │ │ ├── MvcClient.csproj.CoreCompileInputs.cache │ │ │ ├── MvcClient.csproj.FileListAbsolute.txt │ │ │ ├── MvcClient.csprojResolveAssemblyReference.cache │ │ │ ├── MvcClient.dll │ │ │ └── MvcClient.pdb │ ├── MvcClient.csproj.nuget.cache │ ├── MvcClient.csproj.nuget.g.props │ ├── MvcClient.csproj.nuget.g.targets │ └── project.assets.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 ├── PythonHugApi └── main.py ├── QuickstartIdentityServer ├── Config.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── Quickstart │ ├── Account │ │ ├── AccountController.cs │ │ ├── AccountOptions.cs │ │ ├── AccountService.cs │ │ ├── ExternalProvider.cs │ │ ├── LoggedOutViewModel.cs │ │ ├── LoginInputModel.cs │ │ ├── LoginViewModel.cs │ │ ├── LogoutInputModel.cs │ │ └── LogoutViewModel.cs │ ├── Consent │ │ ├── ConsentController.cs │ │ ├── ConsentInputModel.cs │ │ ├── ConsentOptions.cs │ │ ├── ConsentService.cs │ │ ├── ConsentViewModel.cs │ │ ├── ProcessConsentResult.cs │ │ └── ScopeViewModel.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 │ ├── Grants │ │ └── Index.cshtml │ ├── Home │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ └── _ValidationSummary.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── bin │ └── Debug │ │ └── netcoreapp2.0 │ │ ├── QuickstartIdentityServer.deps.json │ │ ├── QuickstartIdentityServer.dll │ │ ├── QuickstartIdentityServer.pdb │ │ ├── QuickstartIdentityServer.runtimeconfig.dev.json │ │ └── QuickstartIdentityServer.runtimeconfig.json ├── obj │ ├── Debug │ │ └── netcoreapp2.0 │ │ │ ├── QuickstartIdentityServer.AssemblyInfo.cs │ │ │ ├── QuickstartIdentityServer.AssemblyInfoInputs.cache │ │ │ ├── QuickstartIdentityServer.csproj.CoreCompileInputs.cache │ │ │ ├── QuickstartIdentityServer.csproj.FileListAbsolute.txt │ │ │ ├── QuickstartIdentityServer.csprojResolveAssemblyReference.cache │ │ │ ├── QuickstartIdentityServer.dll │ │ │ └── QuickstartIdentityServer.pdb │ ├── QuickstartIdentityServer.csproj.nuget.cache │ ├── QuickstartIdentityServer.csproj.nuget.g.props │ ├── QuickstartIdentityServer.csproj.nuget.g.targets │ └── project.assets.json ├── tempkey.rsa └── 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 ├── bin └── Debug │ └── netcoreapp2.0 │ ├── ResourceOwnerClient.deps.json │ ├── ResourceOwnerClient.dll │ ├── ResourceOwnerClient.pdb │ ├── ResourceOwnerClient.runtimeconfig.dev.json │ └── ResourceOwnerClient.runtimeconfig.json └── obj ├── Debug └── netcoreapp2.0 │ ├── ResourceOwnerClient.AssemblyInfo.cs │ ├── ResourceOwnerClient.AssemblyInfoInputs.cache │ ├── ResourceOwnerClient.csproj.CoreCompileInputs.cache │ ├── ResourceOwnerClient.csproj.FileListAbsolute.txt │ ├── ResourceOwnerClient.csprojResolveAssemblyReference.cache │ ├── ResourceOwnerClient.dll │ └── ResourceOwnerClient.pdb ├── ResourceOwnerClient.csproj.nuget.cache ├── ResourceOwnerClient.csproj.nuget.g.props ├── ResourceOwnerClient.csproj.nuget.g.targets └── project.assets.json /.vs/Quickstart7_JavaScriptClient_CallPythonApi/v15/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/.vs/Quickstart7_JavaScriptClient_CallPythonApi/v15/.suo -------------------------------------------------------------------------------- /.vs/Quickstart7_JavaScriptClient_CallPythonApi/v15/Server/sqlite3/db.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/.vs/Quickstart7_JavaScriptClient_CallPythonApi/v15/Server/sqlite3/db.lock -------------------------------------------------------------------------------- /.vs/Quickstart7_JavaScriptClient_CallPythonApi/v15/Server/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/.vs/Quickstart7_JavaScriptClient_CallPythonApi/v15/Server/sqlite3/storage.ide -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Identity Server 4 samples: Clients Call Python Hug Api 2 | 3 | I use hug as python api, [Hug](http://www.hug.rest/) 4 | 5 | You need to install theses python packages: 6 | hug, pyjwt, hug_middleware_cors, requests, cryptography 7 | 8 | Run Python Api, and the port should be 8000:   9 | `hug -f main.py` 10 | 11 | The dotnetcore part of this solution is copied from identity server 4's official samples repository: [Quickstart 7](https://github.com/IdentityServer/IdentityServer4.Samples). 12 | 13 | -------------------------------------------------------------------------------- /src/Client/Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Client/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 IdentityModel.Client; 5 | using Newtonsoft.Json.Linq; 6 | using System; 7 | using System.Net.Http; 8 | using System.Threading.Tasks; 9 | using Newtonsoft.Json; 10 | 11 | namespace Client 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) => MainAsync().GetAwaiter().GetResult(); 16 | 17 | private static async Task MainAsync() 18 | { 19 | // discover endpoints from metadata 20 | var disco = await DiscoveryClient.GetAsync("http://localhost:5000"); 21 | 22 | // request token 23 | var tokenClient = new TokenClient(disco.TokenEndpoint, "client", "secret"); 24 | var tokenResponse = await tokenClient.RequestClientCredentialsAsync("api1"); 25 | 26 | if (tokenResponse.IsError) 27 | { 28 | Console.WriteLine(tokenResponse.Error); 29 | return; 30 | } 31 | 32 | Console.WriteLine(tokenResponse.Json); 33 | Console.WriteLine("\n\n"); 34 | 35 | // call api 36 | var client = new HttpClient(); 37 | client.SetBearerToken(tokenResponse.AccessToken); 38 | 39 | var response = await client.GetAsync("http://localhost:8000/identity"); 40 | if (!response.IsSuccessStatusCode) 41 | { 42 | Console.WriteLine(response.StatusCode); 43 | } 44 | else 45 | { 46 | var content = await response.Content.ReadAsStringAsync(); 47 | var obj = JsonConvert.DeserializeObject(content); 48 | Console.WriteLine(obj); 49 | Console.ReadLine(); 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /src/Client/bin/Debug/netcoreapp2.0/Client.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/Client/bin/Debug/netcoreapp2.0/Client.dll -------------------------------------------------------------------------------- /src/Client/bin/Debug/netcoreapp2.0/Client.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/Client/bin/Debug/netcoreapp2.0/Client.pdb -------------------------------------------------------------------------------- /src/Client/bin/Debug/netcoreapp2.0/Client.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\solen\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\solen\\.nuget\\packages", 6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /src/Client/bin/Debug/netcoreapp2.0/Client.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.0", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "2.0.0" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/Client/obj/Client.csproj.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dgSpecHash": "YuBaosk/EPs5FhmvK+MOwULIZpOyu1rdCvUhIaNMZcsia/4ENlBtIeadSzuwJFAel/3f4i37D/CDvwkSaMu8oQ==", 4 | "success": true 5 | } -------------------------------------------------------------------------------- /src/Client/obj/Client.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | True 5 | NuGet 6 | D:\Projects\DotnetCore\JavaScriptClient_CallPythonApi\src\Client\obj\project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\solen\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder 9 | PackageReference 10 | 4.5.0 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Client/obj/Client.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Client/obj/Debug/netcoreapp2.0/Client.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("Client")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("Client")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("Client")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /src/Client/obj/Debug/netcoreapp2.0/Client.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 6f443e40db29209ee5f3a47be9166030fa0e3b55 2 | -------------------------------------------------------------------------------- /src/Client/obj/Debug/netcoreapp2.0/Client.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | e5d2c3e83f9835a99c447b50caae01cf103542f4 2 | -------------------------------------------------------------------------------- /src/Client/obj/Debug/netcoreapp2.0/Client.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\bin\Debug\netcoreapp2.0\Client.deps.json 2 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\bin\Debug\netcoreapp2.0\Client.runtimeconfig.json 3 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\bin\Debug\netcoreapp2.0\Client.runtimeconfig.dev.json 4 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\bin\Debug\netcoreapp2.0\Client.dll 5 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\bin\Debug\netcoreapp2.0\Client.pdb 6 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\obj\Debug\netcoreapp2.0\Client.csprojResolveAssemblyReference.cache 7 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\obj\Debug\netcoreapp2.0\Client.csproj.CoreCompileInputs.cache 8 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\obj\Debug\netcoreapp2.0\Client.AssemblyInfoInputs.cache 9 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\obj\Debug\netcoreapp2.0\Client.AssemblyInfo.cs 10 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\obj\Debug\netcoreapp2.0\Client.dll 11 | D:\Projects\DotnetCore\7_JavaScriptClient\src\Client\obj\Debug\netcoreapp2.0\Client.pdb 12 | -------------------------------------------------------------------------------- /src/Client/obj/Debug/netcoreapp2.0/Client.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/Client/obj/Debug/netcoreapp2.0/Client.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /src/Client/obj/Debug/netcoreapp2.0/Client.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/Client/obj/Debug/netcoreapp2.0/Client.dll -------------------------------------------------------------------------------- /src/Client/obj/Debug/netcoreapp2.0/Client.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/Client/obj/Debug/netcoreapp2.0/Client.pdb -------------------------------------------------------------------------------- /src/JavaScriptClient/JavaScriptClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/JavaScriptClient/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 JavaScriptClient 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 | } 25 | -------------------------------------------------------------------------------- /src/JavaScriptClient/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5003", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "JavaScriptClient": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:5003" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/JavaScriptClient/bin/Debug/netcoreapp2.0/JavaScriptClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/JavaScriptClient/bin/Debug/netcoreapp2.0/JavaScriptClient.dll -------------------------------------------------------------------------------- /src/JavaScriptClient/bin/Debug/netcoreapp2.0/JavaScriptClient.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/JavaScriptClient/bin/Debug/netcoreapp2.0/JavaScriptClient.pdb -------------------------------------------------------------------------------- /src/JavaScriptClient/bin/Debug/netcoreapp2.0/JavaScriptClient.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\solen\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\solen\\.nuget\\packages", 6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/bin/Debug/netcoreapp2.0/JavaScriptClient.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.0", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "2.0.0" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/jsrsasign/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | echo aaa 3 | 4 | aaa: 5 | cat \ 6 | lib/header.js \ 7 | ../jsrsasign-latest-all-min.js \ 8 | lib/footer.js \ 9 | > lib/jsrsasign.js 10 | 11 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/jsrsasign/lib/footer.js: -------------------------------------------------------------------------------- 1 | exports.SecureRandom = SecureRandom; 2 | exports.rng_seed_time = rng_seed_time; 3 | 4 | exports.BigInteger = BigInteger; 5 | exports.RSAKey = RSAKey; 6 | exports.ECDSA = KJUR.crypto.ECDSA; 7 | exports.DSA = KJUR.crypto.DSA; 8 | exports.Signature = KJUR.crypto.Signature; 9 | exports.MessageDigest = KJUR.crypto.MessageDigest; 10 | exports.Mac = KJUR.crypto.Mac; 11 | exports.KEYUTIL = KEYUTIL; 12 | exports.ASN1HEX = ASN1HEX; 13 | exports.X509 = X509; 14 | exports.CryptoJS = CryptoJS; 15 | 16 | // ext/base64.js 17 | exports.b64tohex = b64tohex; 18 | exports.b64toBA = b64toBA; 19 | 20 | // base64x.js 21 | exports.stoBA = stoBA; 22 | exports.BAtos = BAtos; 23 | exports.BAtohex = BAtohex; 24 | exports.stohex = stohex; 25 | exports.stob64 = stob64; 26 | exports.stob64u = stob64u; 27 | exports.b64utos = b64utos; 28 | exports.b64tob64u = b64tob64u; 29 | exports.b64utob64 = b64utob64; 30 | exports.hex2b64 = hex2b64; 31 | exports.hextob64u = hextob64u; 32 | exports.b64utohex = b64utohex; 33 | exports.b64tohex = b64tohex; 34 | exports.utf8tob64u = utf8tob64u; 35 | exports.b64utoutf8 = b64utoutf8; 36 | exports.utf8tob64 = utf8tob64; 37 | exports.b64toutf8 = b64toutf8; 38 | exports.utf8tohex = utf8tohex; 39 | exports.hextoutf8 = hextoutf8; 40 | exports.hextorstr = hextorstr; 41 | exports.rstrtohex = rstrtohex; 42 | exports.newline_toUnix = newline_toUnix; 43 | exports.newline_toDos = newline_toDos; 44 | exports.intarystrtohex = intarystrtohex; 45 | exports.strdiffidx = strdiffidx; 46 | 47 | exports.KJUR = KJUR; 48 | exports.crypto = KJUR.crypto; 49 | exports.asn1 = KJUR.asn1; 50 | exports.jws = KJUR.jws; 51 | exports.lang = KJUR.lang; 52 | 53 | exports.readFileUTF8 = readFileUTF8; 54 | exports.readFileHexByBin = readFileHexByBin; 55 | exports.readFile = readFile; 56 | exports.saveFile = saveFile; 57 | exports.saveFileBinByHex = saveFileBinByHex; 58 | 59 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/jsrsasign/lib/header.js: -------------------------------------------------------------------------------- 1 | 2 | var navigator = {}; 3 | navigator.userAgent = false; 4 | 5 | var window = {}; 6 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/jsrsasign/lib/lib.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/JavaScriptClient/node_modules/jsrsasign/lib/lib.js -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/jsrsasign/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "jsrsasign@^5.0.7", 5 | "D:\\Projects\\DotnetCore\\7_JavaScriptClient\\src\\JavaScriptClient\\node_modules\\oidc-client" 6 | ] 7 | ], 8 | "_from": "jsrsasign@>=5.0.7-0 <6.0.0-0", 9 | "_id": "jsrsasign@5.1.0", 10 | "_inCache": true, 11 | "_location": "/jsrsasign", 12 | "_nodeVersion": "4.4.7", 13 | "_npmOperationalInternal": { 14 | "host": "packages-16-east.internal.npmjs.com", 15 | "tmp": "tmp/jsrsasign-5.1.0.tgz_1473270540198_0.6754874405451119" 16 | }, 17 | "_npmUser": { 18 | "email": "kenji.urushima@gmail.com", 19 | "name": "kjur" 20 | }, 21 | "_npmVersion": "2.15.9", 22 | "_phantomChildren": {}, 23 | "_requested": { 24 | "name": "jsrsasign", 25 | "raw": "jsrsasign@^5.0.7", 26 | "rawSpec": "^5.0.7", 27 | "scope": null, 28 | "spec": ">=5.0.7-0 <6.0.0-0", 29 | "type": "range" 30 | }, 31 | "_requiredBy": [ 32 | "/oidc-client" 33 | ], 34 | "_resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-5.1.0.tgz", 35 | "_shasum": "2549d559674f6f8956b12bd7f3b5c066b4e0c6ba", 36 | "_shrinkwrap": null, 37 | "_spec": "jsrsasign@^5.0.7", 38 | "_where": "D:\\Projects\\DotnetCore\\7_JavaScriptClient\\src\\JavaScriptClient\\node_modules\\oidc-client", 39 | "author": { 40 | "name": "Kenji Urushima" 41 | }, 42 | "bugs": { 43 | "url": "https://github.com/kjur/jsrsasign/issues" 44 | }, 45 | "dependencies": {}, 46 | "description": "opensource free pure JavaScript cryptographic library supports RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, CMS SignedData, TimeStamp and CAdES and JSON Web Signature(JWS)/Token(JWT)/Key(JWK).", 47 | "devDependencies": {}, 48 | "directories": {}, 49 | "dist": { 50 | "shasum": "2549d559674f6f8956b12bd7f3b5c066b4e0c6ba", 51 | "tarball": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-5.1.0.tgz" 52 | }, 53 | "homepage": "https://github.com/kjur/jsrsasign#readme", 54 | "installable": true, 55 | "keywords": [ 56 | "ASN.1", 57 | "CMS", 58 | "CSR", 59 | "Cryptgraphic Message Syntax", 60 | "DSA", 61 | "Digital Signature", 62 | "Digital Timestamp", 63 | "ECDSA", 64 | "HMac", 65 | "JOSE", 66 | "JSON Web Key", 67 | "JSON Web Signature", 68 | "JSON Web Token", 69 | "JWA", 70 | "JWK", 71 | "JWS", 72 | "JWT", 73 | "Message Digest", 74 | "PKCS#1", 75 | "PKCS#10", 76 | "PKCS#5", 77 | "PKCS#7", 78 | "PKCS#8", 79 | "RFC 3161", 80 | "RSA", 81 | "RSAPSS", 82 | "Signature", 83 | "Time Stamp Token", 84 | "Timestamp", 85 | "X.509", 86 | "certificate", 87 | "hash function", 88 | "private key", 89 | "public key", 90 | "signing" 91 | ], 92 | "licenses": [ 93 | { 94 | "type": "MIT", 95 | "url": "https://raw.github.com/kjur/jsrsasign/master/LICENSE.txt" 96 | } 97 | ], 98 | "main": "lib/jsrsasign.js", 99 | "maintainers": [ 100 | { 101 | "name": "kjur", 102 | "email": "kenji.urushima@gmail.com" 103 | } 104 | ], 105 | "name": "jsrsasign", 106 | "optionalDependencies": {}, 107 | "repository": { 108 | "type": "git", 109 | "url": "git+https://github.com/kjur/jsrsasign.git" 110 | }, 111 | "scripts": { 112 | "test": "echo \"Error: no test specified\" && exit 1" 113 | }, 114 | "version": "5.1.0" 115 | } 116 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"], 3 | "plugins": [ 4 | "babel-plugin-add-module-exports", 5 | ["transform-es2015-classes", { 6 | "loose": true 7 | }] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/.npmignore: -------------------------------------------------------------------------------- 1 | sample/ 2 | test/ 3 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/GitReleaseManager.yaml: -------------------------------------------------------------------------------- 1 | create: 2 | include-footer: false 3 | footer-heading: 4 | footer-content: 5 | footer-includes-milestone: false 6 | milestone-replace-text: 7 | export: 8 | include-created-date-in-title: false 9 | created-date-string-format: 10 | perform-regex-removal: false 11 | regex-text: 12 | multiline-regex: false 13 | issue-labels-include: 14 | - bug 15 | - enhancement 16 | issue-labels-exclude: 17 | - Internal Refactoring 18 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/README.md: -------------------------------------------------------------------------------- 1 | # oidc-client 2 | 3 | Library to provide OpenID Connect (OIDC) and OAuth2 protocol support for client-side, browser-based JavaScript client applications. 4 | Also included is support for user session and access token management. 5 | 6 | ## Install 7 | 8 | ##### Node.js 9 | 10 | Node.js v4.4 or later required. 11 | 12 | ##### NPM 13 | 14 | `npm install oidc-client --save` 15 | 16 | **NOTE**: if you're not already using [babel-polyfill](https://www.npmjs.com/package/babel-polyfill) make sure you run 17 | `npm install --save babel-polyfill` as well. Then include it in your build. 18 | 19 | ##### CommonJS 20 | If you don't use a package manager or a module loader, then you can get the library from the `dist` folder on github [here](dist). 21 | 22 | ## Including in the browser 23 | 24 | If you intend to use this library directly in a browser and are not using UMD/AMD then there is a compiled version in the [~/dist](dist) folder. 25 | It is already bundled/minified and contains the necessary dependencies and polyfills (mainly for ES6 features such as Promises). 26 | 27 | If you are using UMD/AMD and/or you already have included an ES6 polyfill (such as babel-polyfill.js) then you can include the UMD packaged version of the file from the [~/lib](lib) folder. 28 | 29 | ## Building the Source 30 | 31 | ``` 32 | git clone https://github.com/IdentityModel/oidc-client-js.git 33 | cd oidc-client-js 34 | npm install 35 | npm run build 36 | ``` 37 | 38 | ## Running the Sample 39 | 40 | `npm start` 41 | 42 | and then browse to [http://localhost:5000](http://localhost:5000). 43 | 44 | ## Running the Tests 45 | 46 | `npm test` 47 | 48 | ## Docs 49 | 50 | Some initial docs are [here](https://github.com/IdentityModel/oidc-client-js/wiki). 51 | 52 | ## Feedback, Feature requests, and Bugs 53 | 54 | All are welcome on the [issue tracker](https://github.com/IdentityModel/oidc-client-js/issues). 55 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "oidc-client", 3 | "description": "OpenID Connect (OIDC) & OAuth2 client library", 4 | "main": "dist/oidc-client.js", 5 | "authors": [ 6 | "Brock Allen & Dominick Baier" 7 | ], 8 | "license": "Apache-2.0", 9 | "keywords": [ 10 | "oidc", 11 | "oauth", 12 | "openid", 13 | "identitymodel" 14 | ], 15 | "homepage": "https://github.com/IdentityModel/oidc-client-js", 16 | "private": false, 17 | "ignore": [ 18 | "**/.*", 19 | "node_modules", 20 | "bower_components", 21 | "lib", 22 | "sample", 23 | "src", 24 | "test" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var webpackStream = require('webpack-stream'); 3 | var webpack = require('webpack'); 4 | var createWebpackConfig = require('./webpack.base'); 5 | 6 | // entry points for both configs 7 | var npmEntry = './index.js'; 8 | var classicEntry = ['babel-polyfill', npmEntry]; 9 | 10 | // uglify plugin for minification 11 | var uglifyPlugins = [ 12 | new webpack.optimize.UglifyJsPlugin({ 13 | compress: { 14 | warnings: false, 15 | screw_ie8: true, 16 | }, 17 | }) 18 | ]; 19 | 20 | // npm compliant build with source-maps 21 | gulp.task('build-lib-sourcemap', function() { 22 | // run webpack 23 | gulp.src('index.js').pipe(webpackStream(createWebpackConfig({ 24 | entry: npmEntry, 25 | output: { 26 | filename: 'oidc-client.js', 27 | libraryTarget: 'umd' 28 | }, 29 | plugins: [], 30 | devtool: 'inline-source-map' 31 | }))) 32 | .pipe(gulp.dest('lib/')); 33 | }); 34 | 35 | // npm compliant build without source-maps & minified 36 | gulp.task('build-lib-min', function() { 37 | // run webpack 38 | gulp.src('index.js').pipe(webpackStream(createWebpackConfig({ 39 | entry: npmEntry, 40 | output: { 41 | filename: 'oidc-client.min.js', 42 | libraryTarget: 'umd', 43 | }, 44 | plugins: uglifyPlugins, 45 | devtool: null 46 | }))) 47 | .pipe(gulp.dest('lib/')); 48 | }); 49 | 50 | // classic build with sourcemaps 51 | gulp.task('build-dist-sourcemap', function() { 52 | // run webpack 53 | gulp.src('index.js').pipe(webpackStream(createWebpackConfig({ 54 | entry: classicEntry, 55 | output: { 56 | filename: 'oidc-client.js', 57 | libraryTarget: 'var', 58 | library: 'Oidc' 59 | }, 60 | plugins: [], 61 | devtool: 'inline-source-map' 62 | }))) 63 | .pipe(gulp.dest('dist/')); 64 | }); 65 | 66 | // classic build without sourcemaps & minified 67 | gulp.task('build-dist-min', function() { 68 | // run webpack 69 | gulp.src('index.js').pipe(webpackStream(createWebpackConfig({ 70 | entry: classicEntry, 71 | output: { 72 | filename: 'oidc-client.min.js', 73 | libraryTarget: 'var', 74 | library: 'Oidc' 75 | }, 76 | plugins: uglifyPlugins, 77 | devtool: null 78 | }))) 79 | .pipe(gulp.dest('dist/')); 80 | }); 81 | 82 | // putting it all together 83 | gulp.task('build', ['build-lib-sourcemap', 'build-lib-min', 'build-dist-sourcemap', 'build-dist-min']); 84 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/index.js: -------------------------------------------------------------------------------- 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 | export const Log = require('./src/Log'); 5 | export const OidcClient = require('./src/OidcClient'); 6 | export const OidcClientSettings = require('./src/OidcClientSettings'); 7 | export const WebStorageStateStore = require('./src/WebStorageStateStore'); 8 | export const InMemoryWebStorage = require('./src/InMemoryWebStorage'); 9 | export const UserManager = require('./src/UserManager'); 10 | export const AccessTokenEvents = require('./src/AccessTokenEvents'); 11 | export const MetadataService = require('./src/MetadataService'); 12 | export const CordovaPopupNavigator = require('./src/CordovaPopupNavigator'); 13 | export const CordovaIFrameNavigator = require('./src/CordovaIFrameNavigator'); 14 | export const CheckSessionIFrame = require('./src/CheckSessionIFrame'); 15 | export const TokenRevocationClient = require('./src/TokenRevocationClient'); 16 | 17 | export default { 18 | Log, 19 | OidcClient, 20 | OidcClientSettings, 21 | WebStorageStateStore, 22 | InMemoryWebStorage, 23 | UserManager, 24 | AccessTokenEvents, 25 | MetadataService, 26 | CordovaPopupNavigator, 27 | CordovaIFrameNavigator, 28 | CheckSessionIFrame, 29 | TokenRevocationClient 30 | }; 31 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "oidc-client@1.2.2", 5 | "D:\\Projects\\DotnetCore\\7_JavaScriptClient\\src\\JavaScriptClient" 6 | ] 7 | ], 8 | "_from": "oidc-client@1.2.2", 9 | "_id": "oidc-client@1.2.2", 10 | "_inCache": true, 11 | "_location": "/oidc-client", 12 | "_nodeVersion": "4.6.2", 13 | "_npmOperationalInternal": { 14 | "host": "packages-12-west.internal.npmjs.com", 15 | "tmp": "tmp/oidc-client-1.2.2.tgz_1479835762475_0.42853791639208794" 16 | }, 17 | "_npmUser": { 18 | "email": "brockallen@gmail.com", 19 | "name": "brockallen" 20 | }, 21 | "_npmVersion": "2.15.11", 22 | "_phantomChildren": {}, 23 | "_requested": { 24 | "name": "oidc-client", 25 | "raw": "oidc-client@1.2.2", 26 | "rawSpec": "1.2.2", 27 | "scope": null, 28 | "spec": "1.2.2", 29 | "type": "version" 30 | }, 31 | "_requiredBy": [ 32 | "#DEV:/" 33 | ], 34 | "_resolved": "https://registry.npmjs.org/oidc-client/-/oidc-client-1.2.2.tgz", 35 | "_shasum": "baad1c90576cec5c9c14963b9e0dc2b7561c8058", 36 | "_shrinkwrap": null, 37 | "_spec": "oidc-client@1.2.2", 38 | "_where": "D:\\Projects\\DotnetCore\\7_JavaScriptClient\\src\\JavaScriptClient", 39 | "author": { 40 | "name": "Brock Allen & Dominick Baier" 41 | }, 42 | "bugs": { 43 | "url": "https://github.com/IdentityModel/oidc-client-js/issues" 44 | }, 45 | "contributors": [ 46 | { 47 | "name": "Brock Allen", 48 | "email": "brockallen@gmail.com" 49 | }, 50 | { 51 | "name": "Dominick Baier", 52 | "email": "dbaier@leastprivilege.com" 53 | } 54 | ], 55 | "dependencies": { 56 | "jsrsasign": "^5.0.7" 57 | }, 58 | "description": "OpenID Connect (OIDC) & OAuth2 client library", 59 | "devDependencies": { 60 | "babel-core": "^6.7.2", 61 | "babel-loader": "^6.2.4", 62 | "babel-plugin-add-module-exports": "^0.1.2", 63 | "babel-plugin-transform-es2015-classes": "^6.7.7", 64 | "babel-polyfill": "^6.9.1", 65 | "babel-preset-es2015": "^6.6.0", 66 | "babel-register": "^6.7.2", 67 | "chai": "^3.5.0", 68 | "express": "^4.13.4", 69 | "gulp": "^3.9.1", 70 | "mocha": "^2.4.5", 71 | "open": "0.0.5", 72 | "webpack": "^1.12.14", 73 | "webpack-stream": "^3.2.0" 74 | }, 75 | "directories": {}, 76 | "dist": { 77 | "shasum": "baad1c90576cec5c9c14963b9e0dc2b7561c8058", 78 | "tarball": "https://registry.npmjs.org/oidc-client/-/oidc-client-1.2.2.tgz" 79 | }, 80 | "gitHead": "79ab4631468a98bafbefc767883504f15c1fda43", 81 | "homepage": "https://github.com/IdentityModel/oidc-client-js", 82 | "installable": true, 83 | "license": "Apache-2.0", 84 | "main": "lib/oidc-client.min.js", 85 | "maintainers": [ 86 | { 87 | "name": "brockallen", 88 | "email": "brockallen@gmail.com" 89 | } 90 | ], 91 | "name": "oidc-client", 92 | "optionalDependencies": {}, 93 | "peerDependencies": { 94 | "babel-polyfill": ">=6.9.1" 95 | }, 96 | "repository": { 97 | "type": "git", 98 | "url": "git+https://github.com/IdentityModel/oidc-client-js.git" 99 | }, 100 | "scripts": { 101 | "build": "gulp build", 102 | "start": "node sample/server.js", 103 | "test": "mocha --compilers js:babel-register test/unit/*.spec.js" 104 | }, 105 | "typings": "oidc-client.d.ts", 106 | "version": "1.2.2" 107 | } 108 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/AccessTokenEvents.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import Timer from './Timer'; 6 | 7 | const DefaultAccessTokenExpiringNotificationTime = 60; 8 | 9 | export default class AccessTokenEvents { 10 | 11 | constructor({ 12 | accessTokenExpiringNotificationTime = DefaultAccessTokenExpiringNotificationTime, 13 | accessTokenExpiringTimer = new Timer("Access token expiring"), 14 | accessTokenExpiredTimer = new Timer("Access token expired") 15 | } = {}) { 16 | this._accessTokenExpiringNotificationTime = accessTokenExpiringNotificationTime; 17 | 18 | this._accessTokenExpiring = accessTokenExpiringTimer; 19 | this._accessTokenExpired = accessTokenExpiredTimer; 20 | } 21 | 22 | load(container) { 23 | Log.info("AccessTokenEvents.load"); 24 | 25 | this._cancelTimers(); 26 | 27 | // only register events if there's an access token where we care about expiration 28 | if (container.access_token) { 29 | let duration = container.expires_in; 30 | Log.info("access token present, remaining duration:", duration); 31 | 32 | if (duration > 0) { 33 | // only register expiring if we still have time 34 | let expiring = duration - this._accessTokenExpiringNotificationTime; 35 | if (expiring <= 0){ 36 | expiring = 1; 37 | } 38 | Log.info("registering expiring timer in:", expiring); 39 | this._accessTokenExpiring.init(expiring); 40 | } 41 | 42 | // always register expired. if it's negative, it will still fire 43 | let expired = duration + 1; 44 | Log.info("registering expired timer in:", expired); 45 | this._accessTokenExpired.init(expired); 46 | } 47 | } 48 | 49 | unload() { 50 | Log.info("AccessTokenEvents.unload"); 51 | this._cancelTimers(); 52 | } 53 | 54 | _cancelTimers(){ 55 | Log.info("canceling existing access token timers"); 56 | this._accessTokenExpiring.cancel(); 57 | this._accessTokenExpired.cancel(); 58 | } 59 | 60 | addAccessTokenExpiring(cb) { 61 | this._accessTokenExpiring.addHandler(cb); 62 | } 63 | removeAccessTokenExpiring(cb) { 64 | this._accessTokenExpiring.removeHandler(cb); 65 | } 66 | 67 | addAccessTokenExpired(cb) { 68 | this._accessTokenExpired.addHandler(cb); 69 | } 70 | removeAccessTokenExpired(cb) { 71 | this._accessTokenExpired.removeHandler(cb); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/CheckSessionIFrame.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | 6 | const DefaultInterval = 2000; 7 | 8 | export default class CheckSessionIFrame { 9 | constructor(callback, client_id, url, interval) { 10 | this._callback = callback; 11 | this._client_id = client_id; 12 | this._url = url; 13 | this._interval = interval || DefaultInterval; 14 | 15 | var idx = url.indexOf("/", url.indexOf("//") + 2); 16 | this._frame_origin = url.substr(0, idx); 17 | 18 | this._frame = window.document.createElement("iframe"); 19 | this._frame.style.display = "none"; 20 | this._frame.src = url; 21 | window.document.body.appendChild(this._frame); 22 | 23 | this._boundMessageEvent = this._message.bind(this); 24 | window.addEventListener("message", this._boundMessageEvent, false); 25 | } 26 | 27 | _message(e) { 28 | if (e.origin === this._frame_origin && 29 | e.source === this._frame.contentWindow 30 | ) { 31 | if (e.data === "error"){ 32 | Log.error("error message from check session op iframe"); 33 | this.stop(); 34 | } 35 | else if (e.data === "changed"){ 36 | Log.info("changed message from check session op iframe"); 37 | this.stop(); 38 | this._callback(); 39 | } 40 | else { 41 | Log.info(e.data + " message from check session op iframe"); 42 | } 43 | } 44 | } 45 | 46 | start(session_state) { 47 | if (this._session_state !== session_state) { 48 | Log.info("CheckSessionIFrame.start"); 49 | 50 | this.stop(); 51 | 52 | this._session_state = session_state; 53 | 54 | this._timer = window.setInterval(() => { 55 | this._frame.contentWindow.postMessage(this._client_id + " " + this._session_state, this._frame_origin); 56 | }, this._interval); 57 | } 58 | } 59 | 60 | stop() { 61 | Log.info("CheckSessionIFrame.stop"); 62 | 63 | this._session_state = null; 64 | 65 | if (this._timer) { 66 | window.clearInterval(this._timer); 67 | this._timer = null; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/CordovaIFrameNavigator.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import CordovaPopupWindow from './CordovaPopupWindow'; 6 | 7 | export default class CordovaIFrameNavigator { 8 | 9 | prepare(params) { 10 | params.popupWindowFeatures = 'hidden=yes'; 11 | let popup = new CordovaPopupWindow(params); 12 | return Promise.resolve(popup); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/CordovaPopupNavigator.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import CordovaPopupWindow from './CordovaPopupWindow'; 6 | 7 | export default class CordovaPopupNavigator { 8 | 9 | prepare(params) { 10 | let popup = new CordovaPopupWindow(params); 11 | return Promise.resolve(popup); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/CordovaPopupWindow.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | 6 | const DefaultPopupFeatures = 'location=no,toolbar=no,zoom=no'; 7 | const DefaultPopupTarget = "_blank"; 8 | 9 | export default class CordovaPopupWindow { 10 | 11 | constructor(params) { 12 | Log.info("CordovaPopupWindow.ctor"); 13 | 14 | this._promise = new Promise((resolve, reject) => { 15 | this._resolve = resolve; 16 | this._reject = reject; 17 | }); 18 | 19 | this.features = params.popupWindowFeatures || DefaultPopupFeatures; 20 | this.target = params.popupWindowTarget || DefaultPopupTarget; 21 | 22 | this.redirect_uri = params.startUrl; 23 | Log.info("redirect_uri: " + this.redirect_uri); 24 | } 25 | 26 | _isInAppBrowserInstalled(cordovaMetadata) { 27 | return ["cordova-plugin-inappbrowser", "cordova-plugin-inappbrowser.inappbrowser", "org.apache.cordova.inappbrowser"].some(function (name) { 28 | return cordovaMetadata.hasOwnProperty(name) 29 | }) 30 | } 31 | 32 | navigate(params) { 33 | Log.info("CordovaPopupWindow.navigate"); 34 | 35 | if (!params || !params.url) { 36 | this._error("No url provided"); 37 | } else { 38 | if (!window.cordova) { 39 | return this._error("cordova is undefined") 40 | } 41 | 42 | var cordovaMetadata = window.cordova.require("cordova/plugin_list").metadata; 43 | if (this._isInAppBrowserInstalled(cordovaMetadata) === false) { 44 | return this._error("InAppBrowser plugin not found") 45 | } 46 | this._popup = cordova.InAppBrowser.open(params.url, this.target, this.features); 47 | if (this._popup) { 48 | Log.info("popup successfully created"); 49 | 50 | this._exitCallbackEvent = this._exitCallback.bind(this); 51 | this._loadStartCallbackEvent = this._loadStartCallback.bind(this); 52 | 53 | this._popup.addEventListener("exit", this._exitCallbackEvent, false); 54 | this._popup.addEventListener("loadstart", this._loadStartCallbackEvent, false); 55 | } else { 56 | this._error("Error opening popup window"); 57 | } 58 | } 59 | return this.promise; 60 | } 61 | 62 | get promise() { 63 | return this._promise; 64 | } 65 | 66 | _loadStartCallback(event) { 67 | if (event.url.indexOf(this.redirect_uri) === 0) { 68 | this._success({ url: event.url }); 69 | } 70 | } 71 | _exitCallback(message) { 72 | this._error(message); 73 | } 74 | 75 | _success(data) { 76 | this._cleanup(); 77 | 78 | Log.info("Successful response from cordova popup window"); 79 | this._resolve(data); 80 | } 81 | _error(message) { 82 | this._cleanup(); 83 | 84 | Log.error(message); 85 | this._reject(new Error(message)); 86 | } 87 | 88 | _cleanup() { 89 | Log.info("CordovaPopupWindow._cleanup"); 90 | 91 | if (this._popup){ 92 | this._popup.removeEventListener("exit", this._exitCallbackEvent, false); 93 | this._popup.removeEventListener("loadstart", this._loadStartCallbackEvent, false); 94 | this._popup.close(); 95 | } 96 | this._popup = null; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/ErrorResponse.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | 6 | export default class ErrorResponse extends Error { 7 | constructor({error, error_description, error_uri, state}={} 8 | ) { 9 | if (!error){ 10 | Log.error("No error passed to ErrorResponse"); 11 | throw new Error("error"); 12 | } 13 | 14 | super(error_description || error); 15 | 16 | this.name = "ErrorResponse"; 17 | 18 | this.error = error; 19 | this.error_description = error_description; 20 | this.error_uri = error_uri; 21 | 22 | this.state = state; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/Event.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | 6 | export default class Event { 7 | 8 | constructor(name) { 9 | this._name = name; 10 | this._callbacks = []; 11 | } 12 | 13 | addHandler(cb) { 14 | this._callbacks.push(cb); 15 | } 16 | 17 | removeHandler(cb) { 18 | var idx = this._callbacks.findIndex(item => item === cb); 19 | if (idx >= 0) { 20 | this._callbacks.splice(idx, 1); 21 | } 22 | } 23 | 24 | raise(...params) { 25 | Log.info("Raising event: " + this._name); 26 | for (var cb of this._callbacks) { 27 | cb(...params); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/Global.js: -------------------------------------------------------------------------------- 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 | const timer = { 5 | setInterval: function (cb, duration) { 6 | return setInterval(cb, duration); 7 | }, 8 | clearInterval: function (handle) { 9 | return clearInterval(handle); 10 | } 11 | }; 12 | 13 | let testing = false; 14 | 15 | export default class Global { 16 | 17 | static _testing() { 18 | testing = true; 19 | } 20 | 21 | static get location() { 22 | if (!testing) { 23 | return location; 24 | } 25 | } 26 | static get localStorage() { 27 | if (!testing) { 28 | return localStorage; 29 | } 30 | } 31 | static get sessionStorage() { 32 | if (!testing) { 33 | return sessionStorage; 34 | } 35 | } 36 | static get XMLHttpRequest() { 37 | if (!testing) { 38 | return XMLHttpRequest; 39 | } 40 | } 41 | static get timer() { 42 | if (!testing) { 43 | return timer; 44 | } 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/IFrameNavigator.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import IFrameWindow from './IFrameWindow'; 6 | 7 | export default class IFrameNavigator { 8 | 9 | prepare(params) { 10 | let frame = new IFrameWindow(params); 11 | return Promise.resolve(frame); 12 | } 13 | 14 | callback(url) { 15 | Log.info("IFrameNavigator.callback"); 16 | 17 | try { 18 | IFrameWindow.notifyParent(url); 19 | return Promise.resolve(); 20 | } 21 | catch (e) { 22 | return Promise.reject(e); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/IFrameWindow.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | 6 | const DefaultTimeout = 5000; 7 | 8 | export default class IFrameWindow { 9 | 10 | constructor(params) { 11 | Log.info("IFrameWindow.ctor"); 12 | 13 | this._promise = new Promise((resolve, reject) => { 14 | this._resolve = resolve; 15 | this._reject = reject; 16 | }); 17 | 18 | this._boundMessageEvent = this._message.bind(this); 19 | window.addEventListener("message", this._boundMessageEvent, false); 20 | 21 | this._frame = window.document.createElement("iframe"); 22 | this._frame.style.display = "none"; 23 | window.document.body.appendChild(this._frame); 24 | } 25 | 26 | navigate(params) { 27 | Log.info("IFrameWindow.navigate"); 28 | 29 | if (!params || !params.url) { 30 | this._error("No url provided"); 31 | } 32 | else { 33 | let timeout = params.silentRequestTimeout || DefaultTimeout; 34 | Log.info("Using timeout of:", timeout); 35 | this._timer = window.setTimeout(this._timeout.bind(this), timeout); 36 | this._frame.src = params.url; 37 | } 38 | 39 | return this.promise; 40 | } 41 | 42 | get promise() { 43 | return this._promise; 44 | } 45 | 46 | _success(data) { 47 | this._cleanup(); 48 | 49 | Log.info("Successful response from frame window"); 50 | this._resolve(data); 51 | } 52 | _error(message) { 53 | this._cleanup(); 54 | 55 | Log.error(message); 56 | this._reject(new Error(message)); 57 | } 58 | 59 | _cleanup() { 60 | Log.info("IFrameWindow._cleanup"); 61 | 62 | window.removeEventListener("message", this._boundMessageEvent, false); 63 | window.clearTimeout(this._timer); 64 | window.document.body.removeChild(this._frame); 65 | 66 | this._timer = null; 67 | this._frame = null; 68 | this._boundMessageEvent = null; 69 | } 70 | 71 | _timeout() { 72 | Log.info("IFrameWindow._timeout"); 73 | this._error("Frame window timed out"); 74 | } 75 | 76 | _message(e) { 77 | Log.info("IFrameWindow._message"); 78 | 79 | if (this._timer && 80 | e.origin === this._origin && 81 | e.source === this._frame.contentWindow 82 | ) { 83 | let url = e.data; 84 | if (url) { 85 | this._success({ url: url }); 86 | } 87 | else { 88 | this._error("Invalid response from frame"); 89 | } 90 | } 91 | } 92 | 93 | get _origin() { 94 | return location.protocol + "//" + location.host; 95 | } 96 | 97 | static notifyParent(url) { 98 | Log.info("IFrameWindow.notifyParent"); 99 | 100 | if (window.parent && window !== window.parent) { 101 | url = url || window.location.href; 102 | if (url) { 103 | Log.info("posting url message to parent"); 104 | window.parent.postMessage(url, location.protocol + "//" + location.host); 105 | } 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/InMemoryWebStorage.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | 6 | export default class InMemoryWebStorage{ 7 | constructor(){ 8 | this._data = {}; 9 | } 10 | 11 | getItem(key) { 12 | Log.info("InMemoryWebStorage.getItem", key); 13 | return this._data[key]; 14 | } 15 | 16 | setItem(key, value){ 17 | Log.info("InMemoryWebStorage.setItem", key); 18 | this._data[key] = value; 19 | } 20 | 21 | removeItem(key){ 22 | Log.info("InMemoryWebStorage.removeItem", key); 23 | delete this._data[key]; 24 | } 25 | 26 | get length() { 27 | return Object.getOwnPropertyNames(this._data).length; 28 | } 29 | 30 | key(index) { 31 | return Object.getOwnPropertyNames(this._data)[index]; 32 | } 33 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/JsonService.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import Global from './Global'; 6 | 7 | export default class JsonService { 8 | constructor(XMLHttpRequestCtor = Global.XMLHttpRequest) { 9 | this._XMLHttpRequest = XMLHttpRequestCtor; 10 | } 11 | 12 | getJson(url, token) { 13 | Log.info("JsonService.getJson", url); 14 | 15 | if (!url){ 16 | Log.error("No url passed"); 17 | throw new Error("url"); 18 | } 19 | 20 | return new Promise((resolve, reject) => { 21 | 22 | var req = new this._XMLHttpRequest(); 23 | req.open('GET', url); 24 | 25 | req.onload = function() { 26 | Log.info("HTTP response received, status", req.status); 27 | 28 | if (req.status === 200) { 29 | resolve(JSON.parse(req.responseText)); 30 | } 31 | else { 32 | reject(Error(req.statusText + " (" + req.status + ")")); 33 | } 34 | }; 35 | 36 | req.onerror = function() { 37 | Log.error("network error"); 38 | reject(Error("Network Error")); 39 | }; 40 | 41 | if (token) { 42 | Log.info("token passed, setting Authorization header"); 43 | req.setRequestHeader("Authorization", "Bearer " + token); 44 | } 45 | 46 | req.send(); 47 | }); 48 | } 49 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/Log.js: -------------------------------------------------------------------------------- 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 | let nopLogger = { 5 | info(){}, 6 | warn(){}, 7 | error(){} 8 | }; 9 | 10 | const NONE = 0; 11 | const ERROR = 1; 12 | const WARN = 2; 13 | const INFO = 3; 14 | 15 | let logger; 16 | let level; 17 | 18 | export default class Log { 19 | static get NONE() {return NONE}; 20 | static get ERROR() {return ERROR}; 21 | static get WARN() {return WARN}; 22 | static get INFO() {return INFO}; 23 | 24 | static reset(){ 25 | level = INFO; 26 | logger = nopLogger; 27 | } 28 | 29 | static get level(){ 30 | return level; 31 | } 32 | static set level(value){ 33 | if (NONE <= value && value <= INFO){ 34 | level = value; 35 | } 36 | else { 37 | throw new Error("Invalid log level"); 38 | } 39 | } 40 | 41 | static get logger(){ 42 | return logger; 43 | } 44 | static set logger(value){ 45 | if (value.info && value.warn && value.error){ 46 | logger = value; 47 | } 48 | else { 49 | throw new Error("Invalid logger"); 50 | } 51 | } 52 | 53 | static info(...args){ 54 | if (level >= INFO){ 55 | logger.info.apply(logger, Array.from(args)); 56 | } 57 | } 58 | static warn(...args){ 59 | if (level >= WARN){ 60 | logger.warn.apply(logger, Array.from(args)); 61 | } 62 | } 63 | static error(...args){ 64 | if (level >= ERROR){ 65 | logger.error.apply(logger, Array.from(args)); 66 | } 67 | } 68 | } 69 | 70 | Log.reset(); -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/PopupNavigator.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import PopupWindow from './PopupWindow'; 6 | 7 | export default class PopupNavigator { 8 | 9 | prepare(params) { 10 | let popup = new PopupWindow(params); 11 | return Promise.resolve(popup); 12 | } 13 | 14 | callback(url) { 15 | Log.info("PopupNavigator.callback"); 16 | 17 | try { 18 | PopupWindow.notifyOpener(url); 19 | return Promise.resolve(); 20 | } 21 | catch (e) { 22 | return Promise.reject(e); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/RedirectNavigator.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | 6 | export default class RedirectNavigator { 7 | 8 | prepare() { 9 | return Promise.resolve(this); 10 | } 11 | 12 | navigate(params) { 13 | Log.info("RedirectNavigator.navigate"); 14 | 15 | if (!params || !params.url) { 16 | Log.error("No url provided"); 17 | return Promise.reject(new Error("No url provided")); 18 | } 19 | 20 | window.location = params.url; 21 | 22 | return Promise.resolve(); 23 | } 24 | 25 | get url() { 26 | Log.info("RedirectNavigator.url"); 27 | return window.location.href; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/SigninRequest.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import UrlUtility from './UrlUtility'; 6 | import SigninState from './SigninState'; 7 | 8 | export default class SigninRequest { 9 | constructor({ 10 | // mandatory 11 | url, client_id, redirect_uri, response_type, scope, authority, 12 | // optional 13 | data, prompt, display, max_age, ui_locales, id_token_hint, login_hint, acr_values, resource 14 | }) { 15 | if (!url) { 16 | Log.error("No url passed to SigninRequest"); 17 | throw new Error("url"); 18 | } 19 | if (!client_id) { 20 | Log.error("No client_id passed to SigninRequest"); 21 | throw new Error("client_id"); 22 | } 23 | if (!redirect_uri) { 24 | Log.error("No redirect_uri passed to SigninRequest"); 25 | throw new Error("redirect_uri"); 26 | } 27 | if (!response_type) { 28 | Log.error("No response_type passed to SigninRequest"); 29 | throw new Error("response_type"); 30 | } 31 | if (!scope) { 32 | Log.error("No scope passed to SigninRequest"); 33 | throw new Error("scope"); 34 | } 35 | if (!authority) { 36 | Log.error("No authority passed to SigninRequest"); 37 | throw new Error("authority"); 38 | } 39 | 40 | let oidc = SigninRequest.isOidc(response_type); 41 | this.state = new SigninState({ nonce: oidc, data, client_id, authority }); 42 | 43 | url = UrlUtility.addQueryParam(url, "client_id", client_id); 44 | url = UrlUtility.addQueryParam(url, "redirect_uri", redirect_uri); 45 | url = UrlUtility.addQueryParam(url, "response_type", response_type); 46 | url = UrlUtility.addQueryParam(url, "scope", scope); 47 | 48 | url = UrlUtility.addQueryParam(url, "state", this.state.id); 49 | if (oidc) { 50 | url = UrlUtility.addQueryParam(url, "nonce", this.state.nonce); 51 | } 52 | 53 | var optional = { prompt, display, max_age, ui_locales, id_token_hint, login_hint, acr_values, resource }; 54 | for(let key in optional){ 55 | if (optional[key]) { 56 | url = UrlUtility.addQueryParam(url, key, optional[key]); 57 | } 58 | } 59 | 60 | this.url = url; 61 | } 62 | 63 | static isOidc(response_type) { 64 | var result = response_type.split(/\s+/g).filter(function(item) { 65 | return item === "id_token"; 66 | }); 67 | return !!(result[0]); 68 | } 69 | 70 | static isOAuth(response_type) { 71 | var result = response_type.split(/\s+/g).filter(function(item) { 72 | return item === "token"; 73 | }); 74 | return !!(result[0]); 75 | } 76 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/SigninResponse.js: -------------------------------------------------------------------------------- 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 | import UrlUtility from './UrlUtility'; 5 | 6 | const OidcScope = "openid"; 7 | 8 | export default class SigninResponse { 9 | constructor(url) { 10 | 11 | var values = UrlUtility.parseUrlFragment(url, "#"); 12 | 13 | this.error = values.error; 14 | this.error_description = values.error_description; 15 | this.error_uri = values.error_uri; 16 | 17 | this.state = values.state; 18 | this.id_token = values.id_token; 19 | this.session_state = values.session_state; 20 | this.access_token = values.access_token; 21 | this.token_type = values.token_type; 22 | this.scope = values.scope; 23 | this.profile = undefined; // will be set from ResponseValidator 24 | 25 | let expires_in = parseInt(values.expires_in); 26 | if (typeof expires_in === 'number' && expires_in > 0) { 27 | let now = parseInt(Date.now() / 1000); 28 | this.expires_at = now + expires_in; 29 | } 30 | } 31 | 32 | get expires_in() { 33 | if (this.expires_at) { 34 | let now = parseInt(Date.now() / 1000); 35 | return this.expires_at - now; 36 | } 37 | return undefined; 38 | } 39 | 40 | get expired() { 41 | let expires_in = this.expires_in; 42 | if (expires_in !== undefined) { 43 | return expires_in <= 0; 44 | } 45 | return undefined; 46 | } 47 | 48 | get scopes() { 49 | return (this.scope || "").split(" "); 50 | } 51 | 52 | get isOpenIdConnect() { 53 | return this.scopes.indexOf(OidcScope) >= 0 || !!this.id_token; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/SigninState.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import State from './State'; 6 | import random from './random'; 7 | 8 | export default class SigninState extends State { 9 | constructor({nonce, authority, client_id} = {}) { 10 | super(arguments[0]); 11 | 12 | if (nonce === true) { 13 | this._nonce = random(); 14 | } 15 | else if (nonce) { 16 | this._nonce = nonce; 17 | } 18 | 19 | this._authority = authority; 20 | this._client_id = client_id; 21 | } 22 | 23 | get nonce() { 24 | return this._nonce; 25 | } 26 | get authority() { 27 | return this._authority; 28 | } 29 | get client_id() { 30 | return this._client_id; 31 | } 32 | 33 | toStorageString() { 34 | Log.info("SigninState.toStorageString"); 35 | return JSON.stringify({ 36 | id: this.id, 37 | data: this.data, 38 | created: this.created, 39 | nonce: this.nonce, 40 | authority: this.authority, 41 | client_id: this.client_id 42 | }); 43 | } 44 | 45 | static fromStorageString(storageString) { 46 | Log.info("SigninState.fromStorageString"); 47 | var data = JSON.parse(storageString); 48 | return new SigninState(data); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/SignoutRequest.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import UrlUtility from './UrlUtility'; 6 | import State from './State'; 7 | 8 | export default class SignoutRequest { 9 | constructor({url, id_token_hint, post_logout_redirect_uri, data}) { 10 | if (!url) { 11 | Log.error("No url passed to SignoutRequest"); 12 | throw new Error("url"); 13 | } 14 | 15 | if (id_token_hint) { 16 | url = UrlUtility.addQueryParam(url, "id_token_hint", id_token_hint); 17 | 18 | if (post_logout_redirect_uri) { 19 | url = UrlUtility.addQueryParam(url, "post_logout_redirect_uri", post_logout_redirect_uri); 20 | 21 | if (data) { 22 | this.state = new State({ data }); 23 | 24 | url = UrlUtility.addQueryParam(url, "state", this.state.id); 25 | } 26 | } 27 | } 28 | 29 | this.url = url; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/SignoutResponse.js: -------------------------------------------------------------------------------- 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 | import UrlUtility from './UrlUtility'; 5 | 6 | export default class SignoutResponse { 7 | constructor(url) { 8 | 9 | var values = UrlUtility.parseUrlFragment(url, "?"); 10 | 11 | this.error = values.error; 12 | this.error_description = values.error_description; 13 | this.error_uri = values.error_uri; 14 | 15 | this.state = values.state; 16 | } 17 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/SilentRenewService.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | 6 | export default class SilentRenewService { 7 | 8 | constructor(userManager) { 9 | this._userManager = userManager; 10 | this._userManager.events.addAccessTokenExpiring(this._tokenExpiring.bind(this)); 11 | 12 | // this will trigger loading of the user so the expiring events can be initialized 13 | this._userManager.getUser().then(user=>{ 14 | // deliberate nop 15 | }).catch(err=>{ 16 | // catch to suppress errors since we're in a ctor 17 | Log.error("Error from getUser:", err.message); 18 | }); 19 | } 20 | 21 | _tokenExpiring() { 22 | Log.info("SilentRenewService automatically renewing access token"); 23 | 24 | this._userManager.signinSilent().then(user => { 25 | Log.info("Silent token renewal successful"); 26 | }, err => { 27 | Log.error("Error from signinSilent:", err.message); 28 | this._userManager.events._raiseSilentRenewError(err); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/State.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import random from './random'; 6 | 7 | export default class State { 8 | constructor({id, data, created} = {}) { 9 | this._id = id || random(); 10 | this._data = data; 11 | 12 | if (typeof created === 'number' && created > 0) { 13 | this._created = created; 14 | } 15 | else { 16 | this._created = parseInt(Date.now() / 1000); 17 | } 18 | } 19 | 20 | get id() { 21 | return this._id; 22 | } 23 | get data() { 24 | return this._data; 25 | } 26 | get created() { 27 | return this._created; 28 | } 29 | 30 | toStorageString() { 31 | Log.info("State.toStorageString"); 32 | return JSON.stringify({ 33 | id: this.id, 34 | data: this.data, 35 | created: this.created 36 | }); 37 | } 38 | 39 | static fromStorageString(storageString) { 40 | Log.info("State.fromStorageString"); 41 | return new State(JSON.parse(storageString)); 42 | } 43 | 44 | static clearStaleState(storage, age) { 45 | Log.info("State.clearStaleState"); 46 | 47 | var cutoff = Date.now() / 1000 - age; 48 | 49 | return storage.getAllKeys().then(keys => { 50 | Log.info("got keys", keys); 51 | 52 | var promises = []; 53 | for (let key of keys) { 54 | var p = storage.get(key).then(item => { 55 | let remove = false; 56 | 57 | if (item) { 58 | try { 59 | var state = State.fromStorageString(item) 60 | 61 | Log.info("got item from key: ", key, state.created); 62 | 63 | if (state.created <= cutoff) { 64 | remove = true; 65 | } 66 | } 67 | catch (e) { 68 | Log.error("Error parsing state for key", key, e.message); 69 | remove = true; 70 | } 71 | } 72 | else { 73 | Log.info("no item in storage for key: ", key); 74 | remove = true; 75 | } 76 | 77 | if (remove) { 78 | Log.info("removed item for key: ", key); 79 | return storage.remove(key); 80 | } 81 | }); 82 | 83 | promises.push(p); 84 | } 85 | 86 | Log.info("waiting on promise count:", promises.length); 87 | return Promise.all(promises); 88 | }); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/Timer.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import Global from './Global'; 6 | import Event from './Event'; 7 | 8 | const TimerDuration = 5; // 5 seconds 9 | 10 | export default class Timer extends Event { 11 | 12 | constructor(name, timer = Global.timer) { 13 | super(name); 14 | this._timer = timer; 15 | this._nowFunc = () => Date.now() / 1000; 16 | } 17 | 18 | get now() { 19 | return parseInt(this._nowFunc()); 20 | } 21 | 22 | init(duration) { 23 | this.cancel(); 24 | 25 | if (duration <= 0) { 26 | duration = 1; 27 | } 28 | duration = parseInt(duration); 29 | 30 | Log.info("Timer.init timer " + this._name + " for duration:", duration); 31 | this._expiration = this.now + duration; 32 | 33 | // we're using a fairly short timer and then checking the expiration in the 34 | // callback to handle scenarios where the browser device sleeps, and then 35 | // the timers end up getting delayed. 36 | var timerDuration = TimerDuration; 37 | if (duration < timerDuration) { 38 | timerDuration = duration; 39 | } 40 | this._timerHandle = this._timer.setInterval(this._callback.bind(this), timerDuration * 1000); 41 | } 42 | 43 | cancel() { 44 | if (this._timerHandle) { 45 | Log.info("Timer.cancel: ", this._name); 46 | this._timer.clearInterval(this._timerHandle); 47 | this._timerHandle = null; 48 | } 49 | } 50 | 51 | _callback() { 52 | var diff = this._expiration - this.now; 53 | Log.info("Timer._callback; " + this._name + " timer expires in:", diff); 54 | 55 | if (this._expiration <= this.now) { 56 | this.cancel(); 57 | super.raise(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/TokenRevocationClient.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import MetadataService from './MetadataService'; 6 | import Global from './Global'; 7 | 8 | const AccessTokenTypeHint = "access_token"; 9 | 10 | export default class TokenRevocationClient { 11 | constructor(settings, XMLHttpRequestCtor = Global.XMLHttpRequest, MetadataServiceCtor = MetadataService) { 12 | if (!settings) { 13 | Log.error("No settings provided"); 14 | throw new Error("No settings provided."); 15 | } 16 | 17 | this._settings = settings; 18 | this._XMLHttpRequestCtor = XMLHttpRequestCtor; 19 | this._metadataService = new MetadataServiceCtor(this._settings); 20 | } 21 | 22 | revoke(accessToken, required) { 23 | Log.info("TokenRevocationClient.revoke"); 24 | 25 | if (!accessToken) { 26 | Log.error("No accessToken provided"); 27 | throw new Error("No accessToken provided."); 28 | } 29 | 30 | return this._metadataService.getRevocationEndpoint().then(url => { 31 | if (!url) { 32 | if (required) { 33 | Log.error("Revocation not supported"); 34 | throw new Error("Revocation not supported"); 35 | } 36 | 37 | // not required, so don't error and just return 38 | return; 39 | } 40 | 41 | var client_id = this._settings.client_id; 42 | var client_secret = this._settings.client_secret; 43 | return this._revoke(url, client_id, client_secret, accessToken); 44 | }); 45 | } 46 | 47 | _revoke(url, client_id, client_secret, accessToken) { 48 | Log.info("Calling revocation endpoint"); 49 | 50 | return new Promise((resolve, reject) => { 51 | 52 | var xhr = new this._XMLHttpRequestCtor(); 53 | xhr.open("POST", url); 54 | 55 | xhr.onload = () => { 56 | Log.info("HTTP response received, status", xhr.status); 57 | 58 | if (xhr.status === 200) { 59 | resolve(); 60 | } 61 | else { 62 | reject(Error(xhr.statusText + " (" + xhr.status + ")")); 63 | } 64 | }; 65 | 66 | var body = "client_id=" + encodeURIComponent(client_id); 67 | if (client_secret) { 68 | body += "&client_secret=" + encodeURIComponent(client_secret); 69 | } 70 | body += "&token_type_hint=" + encodeURIComponent(AccessTokenTypeHint); 71 | body += "&token=" + encodeURIComponent(accessToken); 72 | 73 | xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 74 | xhr.send(body); 75 | }); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/UrlUtility.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import Global from './Global'; 6 | 7 | export default class UrlUtility { 8 | static addQueryParam(url, name, value) { 9 | if (url.indexOf('?') < 0) { 10 | url += "?"; 11 | } 12 | 13 | if (url[url.length - 1] !== "?") { 14 | url += "&"; 15 | } 16 | 17 | url += encodeURIComponent(name); 18 | url += "="; 19 | url += encodeURIComponent(value); 20 | 21 | return url; 22 | } 23 | 24 | static parseUrlFragment(value, delimiter = "#", global = Global) { 25 | Log.info("UrlUtility.parseUrlFragment"); 26 | 27 | if (typeof value !== 'string'){ 28 | value = global.location.href; 29 | } 30 | 31 | var idx = value.lastIndexOf(delimiter); 32 | if (idx >= 0) { 33 | value = value.substr(idx + 1); 34 | } 35 | 36 | var params = {}, 37 | regex = /([^&=]+)=([^&]*)/g, 38 | m; 39 | 40 | var counter = 0; 41 | while (m = regex.exec(value)) { 42 | params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]); 43 | if (counter++ > 50) { 44 | Log.error("response exceeded expected number of parameters", value); 45 | return { 46 | error: "Response exceeded expected number of parameters" 47 | }; 48 | } 49 | } 50 | 51 | for (var prop in params) { 52 | return params; 53 | } 54 | 55 | return {}; 56 | } 57 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/User.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | 6 | export default class User { 7 | constructor({id_token, session_state, access_token, token_type, scope, profile, expires_at, state}) { 8 | this.id_token = id_token; 9 | this.session_state = session_state; 10 | this.access_token = access_token; 11 | this.token_type = token_type; 12 | this.scope = scope; 13 | this.profile = profile; 14 | this.expires_at = expires_at; 15 | this.state = state; 16 | } 17 | 18 | get expires_in() { 19 | if (this.expires_at) { 20 | let now = parseInt(Date.now() / 1000); 21 | return this.expires_at - now; 22 | } 23 | return undefined; 24 | } 25 | 26 | get expired() { 27 | let expires_in = this.expires_in; 28 | if (expires_in !== undefined) { 29 | return expires_in <= 0; 30 | } 31 | return undefined; 32 | } 33 | 34 | get scopes() { 35 | return (this.scope || "").split(" "); 36 | } 37 | 38 | toStorageString() { 39 | Log.info("User.toStorageString"); 40 | return JSON.stringify({ 41 | id_token: this.id_token, 42 | session_state: this.session_state, 43 | access_token: this.access_token, 44 | token_type: this.token_type, 45 | scope: this.scope, 46 | profile: this.profile, 47 | expires_at: this.expires_at 48 | }); 49 | } 50 | 51 | static fromStorageString(storageString) { 52 | Log.info("User.fromStorageString"); 53 | return new User(JSON.parse(storageString)); 54 | } 55 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/UserInfoService.js: -------------------------------------------------------------------------------- 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 | import JsonService from './JsonService'; 5 | import MetadataService from './MetadataService'; 6 | import Log from './Log'; 7 | 8 | export default class UserInfoService { 9 | constructor(settings, JsonServiceCtor = JsonService, MetadataServiceCtor = MetadataService) { 10 | if (!settings) { 11 | Log.error("No settings passed to UserInfoService"); 12 | throw new Error("settings"); 13 | } 14 | 15 | this._settings = settings; 16 | this._jsonService = new JsonServiceCtor(); 17 | this._metadataService = new MetadataServiceCtor(this._settings); 18 | } 19 | 20 | getClaims(token) { 21 | Log.info("UserInfoService.getClaims"); 22 | 23 | if (!token) { 24 | Log.error("No token passed"); 25 | return Promise.reject(new Error("A token is required")); 26 | } 27 | 28 | return this._metadataService.getUserInfoEndpoint().then(url => { 29 | Log.info("received userinfo url", url); 30 | 31 | return this._jsonService.getJson(url, token).then(claims => { 32 | Log.info("claims received", claims); 33 | return claims; 34 | }); 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/UserManagerEvents.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import AccessTokenEvents from './AccessTokenEvents'; 6 | import Event from './Event'; 7 | 8 | export default class UserManagerEvents extends AccessTokenEvents { 9 | 10 | constructor(settings) { 11 | super(settings); 12 | this._userLoaded = new Event("User loaded"); 13 | this._userUnloaded = new Event("User unloaded"); 14 | this._silentRenewError = new Event("Silent renew error"); 15 | this._userSignedOut = new Event("User signed out"); 16 | this._userSessionChanged = new Event("User session changed"); 17 | } 18 | 19 | load(user, raiseEvent=true) { 20 | Log.info("UserManagerEvents.load"); 21 | super.load(user); 22 | if (raiseEvent) { 23 | this._userLoaded.raise(user); 24 | } 25 | } 26 | unload() { 27 | Log.info("UserManagerEvents.unload"); 28 | super.unload(); 29 | this._userUnloaded.raise(); 30 | } 31 | 32 | addUserLoaded(cb) { 33 | this._userLoaded.addHandler(cb); 34 | } 35 | removeUserLoaded(cb) { 36 | this._userLoaded.removeHandler(cb); 37 | } 38 | 39 | addUserUnloaded(cb) { 40 | this._userUnloaded.addHandler(cb); 41 | } 42 | removeUserUnloaded(cb) { 43 | this._userUnloaded.removeHandler(cb); 44 | } 45 | 46 | addSilentRenewError(cb) { 47 | this._silentRenewError.addHandler(cb); 48 | } 49 | removeSilentRenewError(cb) { 50 | this._silentRenewError.removeHandler(cb); 51 | } 52 | _raiseSilentRenewError(e) { 53 | Log.info("UserManagerEvents._raiseSilentRenewError", e.message); 54 | this._silentRenewError.raise(e); 55 | } 56 | 57 | addUserSignedOut(cb) { 58 | this._userSignedOut.addHandler(cb); 59 | } 60 | removeUserSignedOut(cb) { 61 | this._userSignedOut.removeHandler(cb); 62 | } 63 | _raiseUserSignedOut(e) { 64 | Log.info("UserManagerEvents._raiseUserSignedOut"); 65 | this._userSignedOut.raise(e); 66 | } 67 | 68 | addUserSessionChanged(cb) { 69 | this._userSessionChanged.addHandler(cb); 70 | } 71 | removeUserSessionChanged(cb) { 72 | this._userSessionChanged.removeHandler(cb); 73 | } 74 | _raiseUserSessionChanged(e) { 75 | Log.info("UserManagerEvents._raiseUserSessionChanged"); 76 | this._userSessionChanged.raise(e); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/WebStorageStateStore.js: -------------------------------------------------------------------------------- 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 | import Log from './Log'; 5 | import Global from './Global'; 6 | 7 | export default class WebStorageStateStore { 8 | constructor({prefix = "oidc.", store = Global.localStorage} = {}) { 9 | this._store = store; 10 | this._prefix = prefix; 11 | } 12 | 13 | set(key, value) { 14 | Log.info("WebStorageStateStore.set", key); 15 | 16 | key = this._prefix + key; 17 | 18 | this._store.setItem(key, value); 19 | 20 | return Promise.resolve(); 21 | } 22 | 23 | get(key) { 24 | Log.info("WebStorageStateStore.get", key); 25 | 26 | key = this._prefix + key; 27 | 28 | let item = this._store.getItem(key); 29 | 30 | return Promise.resolve(item); 31 | } 32 | 33 | remove(key) { 34 | Log.info("WebStorageStateStore.remove", key); 35 | 36 | key = this._prefix + key; 37 | 38 | let item = this._store.getItem(key); 39 | this._store.removeItem(key); 40 | 41 | return Promise.resolve(item); 42 | } 43 | 44 | getAllKeys() { 45 | Log.info("WebStorageStateStore.getAllKeys"); 46 | 47 | var keys = []; 48 | 49 | for (let index = 0; index < this._store.length; index++) { 50 | let key = this._store.key(index); 51 | 52 | if (key.indexOf(this._prefix) === 0) { 53 | keys.push(key.substr(this._prefix.length)); 54 | } 55 | } 56 | 57 | return Promise.resolve(keys); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/src/random.js: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------- 2 | // AdalJS v1.0.8 3 | // @preserve Copyright (c) Microsoft Open Technologies, Inc. 4 | // All Rights Reserved 5 | // Apache License 2.0 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | //---------------------------------------------------------------------- 19 | // NOTICE: the code in this file originally developed by Microsoft 20 | // original source: https://github.com/AzureAD/azure-activedirectory-library-for-js/blob/master/lib/adal.js#L1029 21 | 22 | export default function random() { 23 | var guidHolder = 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'; 24 | var hex = '0123456789abcdef'; 25 | var r = 0; 26 | var guidResponse = ""; 27 | for (var i = 0; i < guidHolder.length; i++) { 28 | if (guidHolder[i] !== '-' && guidHolder[i] !== '4') { 29 | // each x and y needs to be random 30 | r = Math.random() * 16 | 0; 31 | } 32 | 33 | if (guidHolder[i] === 'x') { 34 | guidResponse += hex[r]; 35 | } else if (guidHolder[i] === 'y') { 36 | // clock-seq-and-reserved first hex is filtered and remaining hex values are random 37 | r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0?? 38 | r |= 0x8; // set pos 3 to 1 as 1??? 39 | guidResponse += hex[r]; 40 | } else { 41 | guidResponse += guidHolder[i]; 42 | } 43 | } 44 | return guidResponse; 45 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/node_modules/oidc-client/webpack.base.js: -------------------------------------------------------------------------------- 1 | // create a webpack configuration with all common parts included here 2 | var createWebpackConfig = function(options) { 3 | return { 4 | entry: options.entry, 5 | output: options.output, 6 | plugins: options.plugins, 7 | node: { 8 | fs: 'empty' // Because of jsrsasign usage of fs 9 | }, 10 | module: { 11 | loaders: [ 12 | { 13 | test: /.js$/, 14 | loaders: ['babel'], 15 | exclude: /node_modules/, 16 | include: __dirname 17 | } 18 | ] 19 | }, 20 | // this is for the sourcemaps 21 | devtool: options.devtool 22 | }; 23 | }; 24 | 25 | module.exports = createWebpackConfig; 26 | -------------------------------------------------------------------------------- /src/JavaScriptClient/obj/Debug/netcoreapp2.0/JavaScriptClient.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("JavaScriptClient")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("JavaScriptClient")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("JavaScriptClient")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /src/JavaScriptClient/obj/Debug/netcoreapp2.0/JavaScriptClient.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 0cd5a9a0dd7f1a3ba4a794dd4407a79ab014e4c8 2 | -------------------------------------------------------------------------------- /src/JavaScriptClient/obj/Debug/netcoreapp2.0/JavaScriptClient.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 3c1bb43a656e6d2449eec38749d51559607b0911 2 | -------------------------------------------------------------------------------- /src/JavaScriptClient/obj/Debug/netcoreapp2.0/JavaScriptClient.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\bin\Debug\netcoreapp2.0\JavaScriptClient.deps.json 2 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\bin\Debug\netcoreapp2.0\JavaScriptClient.runtimeconfig.json 3 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\bin\Debug\netcoreapp2.0\JavaScriptClient.runtimeconfig.dev.json 4 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\bin\Debug\netcoreapp2.0\JavaScriptClient.dll 5 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\bin\Debug\netcoreapp2.0\JavaScriptClient.pdb 6 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\obj\Debug\netcoreapp2.0\JavaScriptClient.csprojResolveAssemblyReference.cache 7 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\obj\Debug\netcoreapp2.0\JavaScriptClient.csproj.CoreCompileInputs.cache 8 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\obj\Debug\netcoreapp2.0\JavaScriptClient.AssemblyInfoInputs.cache 9 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\obj\Debug\netcoreapp2.0\JavaScriptClient.AssemblyInfo.cs 10 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\obj\Debug\netcoreapp2.0\JavaScriptClient.dll 11 | D:\Projects\DotnetCore\7_JavaScriptClient\src\JavaScriptClient\obj\Debug\netcoreapp2.0\JavaScriptClient.pdb 12 | -------------------------------------------------------------------------------- /src/JavaScriptClient/obj/Debug/netcoreapp2.0/JavaScriptClient.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/JavaScriptClient/obj/Debug/netcoreapp2.0/JavaScriptClient.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /src/JavaScriptClient/obj/Debug/netcoreapp2.0/JavaScriptClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/JavaScriptClient/obj/Debug/netcoreapp2.0/JavaScriptClient.dll -------------------------------------------------------------------------------- /src/JavaScriptClient/obj/Debug/netcoreapp2.0/JavaScriptClient.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/JavaScriptClient/obj/Debug/netcoreapp2.0/JavaScriptClient.pdb -------------------------------------------------------------------------------- /src/JavaScriptClient/obj/JavaScriptClient.csproj.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dgSpecHash": "2+3ti0DcfQ8nHw5nTA8WHgICygGem5fCadtTnkREHPk0TgJ8zUbuZFmcX+Ei0/EjUZtaV3GT662a8poKSWDzyw==", 4 | "success": true 5 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/obj/JavaScriptClient.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | True 5 | NuGet 6 | D:\Projects\DotnetCore\JavaScriptClient_CallPythonApi\src\JavaScriptClient\obj\project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\solen\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder 9 | PackageReference 10 | 4.5.0 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/JavaScriptClient/obj/JavaScriptClient.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/wwwroot/app.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | function log() { 4 | document.getElementById('results').innerText = ''; 5 | 6 | Array.prototype.forEach.call(arguments, function (msg) { 7 | if (msg instanceof Error) { 8 | msg = "Error: " + msg.message; 9 | } 10 | else if (typeof msg !== 'string') { 11 | msg = JSON.stringify(msg, null, 2); 12 | } 13 | document.getElementById('results').innerHTML += msg + '\r\n'; 14 | }); 15 | } 16 | 17 | document.getElementById("login").addEventListener("click", login, false); 18 | document.getElementById("api").addEventListener("click", api, false); 19 | document.getElementById("logout").addEventListener("click", logout, false); 20 | 21 | var config = { 22 | authority: "http://localhost:5000", 23 | client_id: "js", 24 | redirect_uri: "http://localhost:5003/callback.html", 25 | response_type: "id_token token", 26 | scope:"openid profile api1", 27 | post_logout_redirect_uri : "http://localhost:5003/index.html", 28 | }; 29 | var mgr = new Oidc.UserManager(config); 30 | 31 | mgr.getUser().then(function (user) { 32 | if (user) { 33 | log("User logged in", user.profile); 34 | } 35 | else { 36 | log("User not logged in"); 37 | } 38 | }); 39 | 40 | function login() { 41 | mgr.signinRedirect(); 42 | } 43 | 44 | function api() { 45 | mgr.getUser().then(function (user) { 46 | var url = "http://localhost:8000/identity"; 47 | 48 | var xhr = new XMLHttpRequest(); 49 | xhr.open("GET", url); 50 | xhr.onload = function () { 51 | log(xhr.status, JSON.parse(xhr.responseText)); 52 | } 53 | xhr.setRequestHeader("Authorization", "Bearer " + user.access_token); 54 | xhr.send(); 55 | }); 56 | } 57 | 58 | function logout() { 59 | mgr.signoutRedirect(); 60 | } -------------------------------------------------------------------------------- /src/JavaScriptClient/wwwroot/callback.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /src/JavaScriptClient/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

13 | 
14 |     
15 |     
16 | 
17 | 


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


--------------------------------------------------------------------------------
/src/MvcClient/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
 1 | using System.Threading.Tasks;
 2 | using Microsoft.AspNetCore.Mvc;
 3 | using Microsoft.AspNetCore.Authorization;
 4 | using Microsoft.AspNetCore.Authentication;
 5 | using System.Net.Http;
 6 | using Newtonsoft.Json.Linq;
 7 | using IdentityModel.Client;
 8 | using Newtonsoft.Json;
 9 | 
10 | namespace MvcClient.Controllers
11 | {
12 |     public class HomeController : Controller
13 |     {
14 |         public IActionResult Index()
15 |         {
16 |             return View();
17 |         }
18 | 
19 |         [Authorize]
20 |         public IActionResult Secure()
21 |         {
22 |             ViewData["Message"] = "Secure page.";
23 | 
24 |             return View();
25 |         }
26 | 
27 |         public async Task Logout()
28 |         {
29 |             await HttpContext.SignOutAsync("Cookies");
30 |             await HttpContext.SignOutAsync("oidc");
31 |         }
32 | 
33 |         public IActionResult Error()
34 |         {
35 |             return View();
36 |         }
37 | 
38 |         public async Task CallApiUsingClientCredentials()
39 |         {
40 |             var tokenClient = new TokenClient("http://localhost:5000/connect/token", "mvc", "secret");
41 |             var tokenResponse = await tokenClient.RequestClientCredentialsAsync("api1");
42 | 
43 |             var client = new HttpClient();
44 |             client.SetBearerToken(tokenResponse.AccessToken);
45 |             var content = await client.GetStringAsync("http://localhost:8000/identity");
46 | 
47 |             ViewBag.Json = JsonConvert.DeserializeObject(content).ToString();
48 |             return View("json");
49 |         }
50 | 
51 |         public async Task CallApiUsingUserAccessToken()
52 |         {
53 |             var accessToken = await HttpContext.GetTokenAsync("access_token");
54 | 
55 |             var client = new HttpClient();
56 |             client.SetBearerToken(accessToken);
57 |             var content = await client.GetStringAsync("http://localhost:8000/identity");
58 | 
59 |             ViewBag.Json = JsonConvert.DeserializeObject(content).ToString();
60 |             return View("json");
61 |         }
62 |     }
63 | }


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


--------------------------------------------------------------------------------
/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 | }


--------------------------------------------------------------------------------
/src/MvcClient/Properties/launchSettings.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "iisSettings": {
 3 |     "windowsAuthentication": false,
 4 |     "anonymousAuthentication": true,
 5 |     "iisExpress": {
 6 |       "applicationUrl": "http://localhost:5002",
 7 |       "sslPort": 0
 8 |     }
 9 |   },
10 |   "profiles": {
11 |     "IIS Express": {
12 |       "commandName": "IISExpress",
13 |       "launchBrowser": true,
14 |       "environmentVariables": {
15 |         "ASPNETCORE_ENVIRONMENT": "Development"
16 |       }
17 |     },
18 |     "MvcClient": {
19 |       "commandName": "Project",
20 |       "launchBrowser": true,
21 |       "environmentVariables": {
22 |         "ASPNETCORE_ENVIRONMENT": "Development"
23 |       },
24 |       "applicationUrl": "http://localhost:5002"
25 |     }
26 |   }
27 | }


--------------------------------------------------------------------------------
/src/MvcClient/Startup.cs:
--------------------------------------------------------------------------------
 1 | using Microsoft.AspNetCore.Builder;
 2 | using Microsoft.AspNetCore.Hosting;
 3 | using Microsoft.Extensions.DependencyInjection;
 4 | using System.IdentityModel.Tokens.Jwt;
 5 | 
 6 | namespace MvcClient
 7 | {
 8 |     public class Startup
 9 |     {
10 |         public void ConfigureServices(IServiceCollection services)
11 |         {
12 |             services.AddMvc();
13 | 
14 |             JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
15 | 
16 |             services.AddAuthentication(options =>
17 |                 {
18 |                     options.DefaultScheme = "Cookies";
19 |                     options.DefaultChallengeScheme = "oidc";
20 |                 })
21 |                 .AddCookie("Cookies")
22 |                 .AddOpenIdConnect("oidc", options =>
23 |                 {
24 |                     options.SignInScheme = "Cookies";
25 | 
26 |                     options.Authority = "http://localhost:5000";
27 |                     options.RequireHttpsMetadata = false;
28 | 
29 |                     options.ClientId = "mvc";
30 |                     options.ClientSecret = "secret";
31 |                     options.ResponseType = "code id_token";
32 | 
33 |                     options.SaveTokens = true;
34 |                     options.GetClaimsFromUserInfoEndpoint = true;
35 | 
36 |                     options.Scope.Add("api1");
37 |                     options.Scope.Add("offline_access");
38 |                 });
39 |         }
40 | 
41 |         public void Configure(IApplicationBuilder app, IHostingEnvironment env)
42 |         {
43 |             if (env.IsDevelopment())
44 |             {
45 |                 app.UseDeveloperExceptionPage();
46 |             }
47 |             else
48 |             {
49 |                 app.UseExceptionHandler("/Home/Error");
50 |             }
51 | 
52 |             app.UseAuthentication();
53 | 
54 |             app.UseStaticFiles();
55 |             app.UseMvcWithDefaultRoute();
56 |         }
57 |     }
58 | }


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

OpenID Connect MVC Client

-------------------------------------------------------------------------------- /src/MvcClient/Views/Home/Secure.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Authentication; 2 | @{ 3 | ViewData["Title"] = "Secure"; 4 | } 5 |

@ViewData["Title"]

6 | 7 |

User claims

8 | 9 | 12 | 15 | 16 |
17 | @foreach (var claim in User.Claims) 18 | { 19 |
@claim.Type
20 |
@claim.Value
21 | 22 | } 23 |
access token
24 |
@await ViewContext.HttpContext.GetTokenAsync("access_token")
25 | 26 |
refresh token
27 |
@await ViewContext.HttpContext.GetTokenAsync("refresh_token")
28 |
29 | -------------------------------------------------------------------------------- /src/MvcClient/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Error"; 3 | } 4 | 5 |

Error.

6 |

An error occurred while processing your request.

7 | 8 |

Development Mode

9 |

10 | Swapping to Development environment will display more detailed information about the error that occurred. 11 |

12 |

13 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 14 |

15 | -------------------------------------------------------------------------------- /src/MvcClient/Views/Shared/Json.cshtml: -------------------------------------------------------------------------------- 1 | 

API response

2 | 3 |
@ViewBag.Json
-------------------------------------------------------------------------------- /src/MvcClient/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - MvcClient 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 43 |
44 | @RenderBody() 45 |
46 |
47 |

© 2016 - MvcClient

48 |
49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 61 | 65 | 66 | 67 | 68 | @RenderSection("scripts", required: false) 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/MvcClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MvcClient 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /src/MvcClient/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/MvcClient/bin/Debug/netcoreapp2.0/MvcClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/bin/Debug/netcoreapp2.0/MvcClient.dll -------------------------------------------------------------------------------- /src/MvcClient/bin/Debug/netcoreapp2.0/MvcClient.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/bin/Debug/netcoreapp2.0/MvcClient.pdb -------------------------------------------------------------------------------- /src/MvcClient/bin/Debug/netcoreapp2.0/MvcClient.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\solen\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\solen\\.nuget\\packages", 6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /src/MvcClient/bin/Debug/netcoreapp2.0/MvcClient.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.0", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "2.0.0" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/MvcClient/obj/Debug/netcoreapp2.0/MvcClient.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("MvcClient")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("MvcClient")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("MvcClient")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /src/MvcClient/obj/Debug/netcoreapp2.0/MvcClient.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | a30361c1153f20eb08fbad44c9cc181468dae9de 2 | -------------------------------------------------------------------------------- /src/MvcClient/obj/Debug/netcoreapp2.0/MvcClient.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | f5df486625a7ea3163df3d96de29848cbd9d18a4 2 | -------------------------------------------------------------------------------- /src/MvcClient/obj/Debug/netcoreapp2.0/MvcClient.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\bin\Debug\netcoreapp2.0\MvcClient.deps.json 2 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\bin\Debug\netcoreapp2.0\MvcClient.runtimeconfig.json 3 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\bin\Debug\netcoreapp2.0\MvcClient.runtimeconfig.dev.json 4 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\bin\Debug\netcoreapp2.0\MvcClient.dll 5 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\bin\Debug\netcoreapp2.0\MvcClient.pdb 6 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\obj\Debug\netcoreapp2.0\MvcClient.csprojResolveAssemblyReference.cache 7 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\obj\Debug\netcoreapp2.0\MvcClient.csproj.CoreCompileInputs.cache 8 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\obj\Debug\netcoreapp2.0\MvcClient.AssemblyInfoInputs.cache 9 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\obj\Debug\netcoreapp2.0\MvcClient.AssemblyInfo.cs 10 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\obj\Debug\netcoreapp2.0\MvcClient.dll 11 | D:\Projects\DotnetCore\7_JavaScriptClient\src\MvcClient\obj\Debug\netcoreapp2.0\MvcClient.pdb 12 | -------------------------------------------------------------------------------- /src/MvcClient/obj/Debug/netcoreapp2.0/MvcClient.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/obj/Debug/netcoreapp2.0/MvcClient.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /src/MvcClient/obj/Debug/netcoreapp2.0/MvcClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/obj/Debug/netcoreapp2.0/MvcClient.dll -------------------------------------------------------------------------------- /src/MvcClient/obj/Debug/netcoreapp2.0/MvcClient.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/obj/Debug/netcoreapp2.0/MvcClient.pdb -------------------------------------------------------------------------------- /src/MvcClient/obj/MvcClient.csproj.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dgSpecHash": "CGyH8L9gmPkKONFo2sUHxveMFwZ/3ChLJd4f6I+PKxrFxUhNcSt3sBR22KR88d+dXzL4spdqQrtjJ5W60eTsGg==", 4 | "success": true 5 | } -------------------------------------------------------------------------------- /src/MvcClient/obj/MvcClient.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | True 5 | NuGet 6 | D:\Projects\DotnetCore\JavaScriptClient_CallPythonApi\src\MvcClient\obj\project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\solen\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder 9 | PackageReference 10 | 4.5.0 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/MvcClient/obj/MvcClient.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Set widths on the form inputs since otherwise they're 100% wide */ 14 | input, 15 | select, 16 | textarea { 17 | max-width: 280px; 18 | } 19 | 20 | /* Carousel */ 21 | .carousel-caption p { 22 | font-size: 20px; 23 | line-height: 1.4; 24 | } 25 | 26 | /* Make .svg files in the carousel display properly in older browsers */ 27 | .carousel-inner .item img[src$=".svg"] 28 | { 29 | width: 100%; 30 | } 31 | 32 | /* Hide/rearrange for smaller screens */ 33 | @media screen and (max-width: 767px) { 34 | /* Hide captions */ 35 | .carousel-caption { 36 | display: none 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /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}} -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 2" 33 | }, 34 | "version": "3.3.6", 35 | "_release": "3.3.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.6", 39 | "commit": "81df608a40bf0629a1dc08e584849bb1e43e0b7a" 40 | }, 41 | "_source": "git://github.com/twbs/bootstrap.git", 42 | "_target": "3.3.6", 43 | "_originalSource": "bootstrap" 44 | } -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2015 Twitter, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/MvcClient/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /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') -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /src/MvcClient/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /src/PythonHugApi/main.py: -------------------------------------------------------------------------------- 1 | import hug 2 | import jwt 3 | import json 4 | from hug_middleware_cors import CORSMiddleware 5 | import requests 6 | from jwt.algorithms import get_default_algorithms 7 | 8 | api = hug.API(__name__) 9 | api.http.add_middleware(CORSMiddleware(api)) 10 | 11 | 12 | def token_verify(token): 13 | access_token = token.replace('Bearer ', '') 14 | token_header = jwt.get_unverified_header(access_token) 15 | res = requests.get('http://localhost:5000/.well-known/openid-configuration') 16 | jwk_uri = res.json()['jwks_uri'] 17 | res = requests.get(jwk_uri) 18 | jwk_keys = res.json() 19 | 20 | rsa = get_default_algorithms()['RS256'] 21 | key = json.dumps(jwk_keys['keys'][0]) 22 | public_key = rsa.from_jwk(key) 23 | 24 | try: 25 | result = jwt.decode(access_token, public_key, algorithms=[ 26 | token_header['alg']], audience='api1') 27 | return result 28 | except jwt.DecodeError: 29 | return False 30 | 31 | 32 | token_key_authentication = hug.authentication.token(token_verify) 33 | 34 | 35 | @hug.get('/identity', requires=token_key_authentication) 36 | def root(user: hug.directives.user): 37 | print(user) 38 | return user 39 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5000/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "QuickstartIdentityServer": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "launchUrl": "http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "applicationUrl": "http://localhost:5000/" 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/Account/AccountOptions.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; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class AccountOptions 10 | { 11 | public static bool AllowLocalLogin = true; 12 | public static bool AllowRememberLogin = true; 13 | public static TimeSpan RememberMeLoginDuration = TimeSpan.FromDays(30); 14 | 15 | public static bool ShowLogoutPrompt = true; 16 | public static bool AutomaticRedirectAfterSignOut = false; 17 | 18 | // to enable windows authentication, the host (IIS or IIS Express) also must have 19 | // windows auth enabled. 20 | public static bool WindowsAuthenticationEnabled = true; 21 | public static bool IncludeWindowsGroups = false; 22 | // specify the Windows authentication scheme and display name 23 | public static readonly string WindowsAuthenticationSchemeName = "Windows"; 24 | 25 | public static string InvalidCredentialsErrorMessage = "Invalid username or password"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/Account/LoggedOutViewModel.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 LoggedOutViewModel 8 | { 9 | public string PostLogoutRedirectUri { get; set; } 10 | public string ClientName { get; set; } 11 | public string SignOutIframeUrl { get; set; } 12 | 13 | public bool AutomaticRedirectAfterSignOut { get; set; } 14 | 15 | public string LogoutId { get; set; } 16 | public bool TriggerExternalSignout => ExternalAuthenticationScheme != null; 17 | public string ExternalAuthenticationScheme { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/Account/LoginViewModel.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; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | 9 | namespace IdentityServer4.Quickstart.UI 10 | { 11 | public class LoginViewModel : LoginInputModel 12 | { 13 | public bool AllowRememberLogin { get; set; } 14 | public bool EnableLocalLogin { get; set; } 15 | 16 | public IEnumerable ExternalProviders { get; set; } 17 | public IEnumerable VisibleExternalProviders => ExternalProviders.Where(x => !String.IsNullOrWhiteSpace(x.DisplayName)); 18 | 19 | public bool IsExternalLoginOnly => EnableLocalLogin == false && ExternalProviders?.Count() == 1; 20 | public string ExternalLoginScheme => ExternalProviders?.SingleOrDefault()?.AuthenticationScheme; 21 | } 22 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/Consent/ConsentController.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.Services; 6 | using IdentityServer4.Stores; 7 | using Microsoft.AspNetCore.Mvc; 8 | using Microsoft.Extensions.Logging; 9 | using System.Threading.Tasks; 10 | 11 | namespace IdentityServer4.Quickstart.UI 12 | { 13 | /// 14 | /// This controller processes the consent UI 15 | /// 16 | [SecurityHeaders] 17 | public class ConsentController : Controller 18 | { 19 | private readonly ConsentService _consent; 20 | 21 | public ConsentController( 22 | IIdentityServerInteractionService interaction, 23 | IClientStore clientStore, 24 | IResourceStore resourceStore, 25 | ILogger logger) 26 | { 27 | _consent = new ConsentService(interaction, clientStore, resourceStore, logger); 28 | } 29 | 30 | /// 31 | /// Shows the consent screen 32 | /// 33 | /// 34 | /// 35 | [HttpGet] 36 | public async Task Index(string returnUrl) 37 | { 38 | var vm = await _consent.BuildViewModelAsync(returnUrl); 39 | if (vm != null) 40 | { 41 | return View("Index", vm); 42 | } 43 | 44 | return View("Error"); 45 | } 46 | 47 | /// 48 | /// Handles the consent screen postback 49 | /// 50 | [HttpPost] 51 | [ValidateAntiForgeryToken] 52 | public async Task Index(ConsentInputModel model) 53 | { 54 | var result = await _consent.ProcessConsent(model); 55 | 56 | if (result.IsRedirect) 57 | { 58 | return Redirect(result.RedirectUri); 59 | } 60 | 61 | if (result.HasValidationError) 62 | { 63 | ModelState.AddModelError("", result.ValidationError); 64 | } 65 | 66 | if (result.ShowView) 67 | { 68 | return View("Index", result.ViewModel); 69 | } 70 | 71 | return View("Error"); 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/Consent/ConsentOptions.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 ConsentOptions 8 | { 9 | public static bool EnableOfflineAccess = true; 10 | public static string OfflineAccessDisplayName = "Offline Access"; 11 | public static string OfflineAccessDescription = "Access to your applications and resources, even when you are offline"; 12 | 13 | public static readonly string MustChooseOneErrorMessage = "You must pick at least one permission"; 14 | public static readonly string InvalidSelectionErrorMessage = "Invalid selection"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/Consent/ConsentViewModel.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 ConsentViewModel : ConsentInputModel 10 | { 11 | public string ClientName { get; set; } 12 | public string ClientUrl { get; set; } 13 | public string ClientLogoUrl { get; set; } 14 | public bool AllowRememberConsent { get; set; } 15 | 16 | public IEnumerable IdentityScopes { get; set; } 17 | public IEnumerable ResourceScopes { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/Grants/GrantsController.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.Services; 6 | using IdentityServer4.Stores; 7 | using Microsoft.AspNetCore.Mvc; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Threading.Tasks; 11 | using Microsoft.AspNetCore.Authorization; 12 | 13 | namespace IdentityServer4.Quickstart.UI 14 | { 15 | /// 16 | /// This sample controller allows a user to revoke grants given to clients 17 | /// 18 | [SecurityHeaders] 19 | [Authorize(AuthenticationSchemes = IdentityServer4.IdentityServerConstants.DefaultCookieAuthenticationScheme)] 20 | public class GrantsController : Controller 21 | { 22 | private readonly IIdentityServerInteractionService _interaction; 23 | private readonly IClientStore _clients; 24 | private readonly IResourceStore _resources; 25 | 26 | public GrantsController(IIdentityServerInteractionService interaction, 27 | IClientStore clients, 28 | IResourceStore resources) 29 | { 30 | _interaction = interaction; 31 | _clients = clients; 32 | _resources = resources; 33 | } 34 | 35 | /// 36 | /// Show list of grants 37 | /// 38 | [HttpGet] 39 | public async Task Index() 40 | { 41 | return View("Index", await BuildViewModelAsync()); 42 | } 43 | 44 | /// 45 | /// Handle postback to revoke a client 46 | /// 47 | [HttpPost] 48 | [ValidateAntiForgeryToken] 49 | public async Task Revoke(string clientId) 50 | { 51 | await _interaction.RevokeUserConsentAsync(clientId); 52 | return RedirectToAction("Index"); 53 | } 54 | 55 | private async Task BuildViewModelAsync() 56 | { 57 | var grants = await _interaction.GetAllUserConsentsAsync(); 58 | 59 | var list = new List(); 60 | foreach(var grant in grants) 61 | { 62 | var client = await _clients.FindClientByIdAsync(grant.ClientId); 63 | if (client != null) 64 | { 65 | var resources = await _resources.FindResourcesByScopeAsync(grant.Scopes); 66 | 67 | var item = new GrantViewModel() 68 | { 69 | ClientId = client.ClientId, 70 | ClientName = client.ClientName ?? client.ClientId, 71 | ClientLogoUrl = client.LogoUri, 72 | ClientUrl = client.ClientUri, 73 | Created = grant.CreationTime, 74 | Expires = grant.Expiration, 75 | IdentityGrantNames = resources.IdentityResources.Select(x => x.DisplayName ?? x.Name).ToArray(), 76 | ApiGrantNames = resources.ApiResources.Select(x => x.DisplayName ?? x.Name).ToArray() 77 | }; 78 | 79 | list.Add(item); 80 | } 81 | } 82 | 83 | return new GrantsViewModel 84 | { 85 | Grants = list 86 | }; 87 | } 88 | } 89 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/Grants/GrantsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace IdentityServer4.Quickstart.UI 5 | { 6 | public class GrantsViewModel 7 | { 8 | public IEnumerable Grants { get; set; } 9 | } 10 | 11 | public class GrantViewModel 12 | { 13 | public string ClientId { get; set; } 14 | public string ClientName { get; set; } 15 | public string ClientUrl { get; set; } 16 | public string ClientLogoUrl { get; set; } 17 | public DateTime Created { get; set; } 18 | public DateTime? Expires { get; set; } 19 | public IEnumerable IdentityGrantNames { get; set; } 20 | public IEnumerable ApiGrantNames { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/Home/HomeController.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.Services; 6 | using Microsoft.AspNetCore.Mvc; 7 | using System.Threading.Tasks; 8 | 9 | namespace IdentityServer4.Quickstart.UI 10 | { 11 | [SecurityHeaders] 12 | public class HomeController : Controller 13 | { 14 | private readonly IIdentityServerInteractionService _interaction; 15 | 16 | public HomeController(IIdentityServerInteractionService interaction) 17 | { 18 | _interaction = interaction; 19 | } 20 | 21 | public IActionResult Index() 22 | { 23 | return View(); 24 | } 25 | 26 | /// 27 | /// Shows the error page 28 | /// 29 | public async Task Error(string errorId) 30 | { 31 | var vm = new ErrorViewModel(); 32 | 33 | // retrieve error details from identityserver 34 | var message = await _interaction.GetErrorContextAsync(errorId); 35 | if (message != null) 36 | { 37 | vm.Error = message; 38 | } 39 | 40 | return View("Error", vm); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/SecurityHeadersAttribute.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 Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.Filters; 7 | 8 | namespace IdentityServer4.Quickstart.UI 9 | { 10 | public class SecurityHeadersAttribute : ActionFilterAttribute 11 | { 12 | public override void OnResultExecuting(ResultExecutingContext context) 13 | { 14 | var result = context.Result; 15 | if (result is ViewResult) 16 | { 17 | if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Type-Options")) 18 | { 19 | context.HttpContext.Response.Headers.Add("X-Content-Type-Options", "nosniff"); 20 | } 21 | if (!context.HttpContext.Response.Headers.ContainsKey("X-Frame-Options")) 22 | { 23 | context.HttpContext.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN"); 24 | } 25 | 26 | var csp = "default-src 'self';"; 27 | // an example if you need client images to be displayed from twitter 28 | //var csp = "default-src 'self'; img-src 'self' https://pbs.twimg.com"; 29 | 30 | // once for standards compliant browsers 31 | if (!context.HttpContext.Response.Headers.ContainsKey("Content-Security-Policy")) 32 | { 33 | context.HttpContext.Response.Headers.Add("Content-Security-Policy", csp); 34 | } 35 | // and once again for IE 36 | if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Security-Policy")) 37 | { 38 | context.HttpContext.Response.Headers.Add("X-Content-Security-Policy", csp); 39 | } 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Quickstart/TestUsers.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 IdentityModel; 6 | using IdentityServer4.Test; 7 | using System.Collections.Generic; 8 | using System.Security.Claims; 9 | 10 | namespace IdentityServer4.Quickstart.UI 11 | { 12 | public class TestUsers 13 | { 14 | public static List Users = new List 15 | { 16 | new TestUser{SubjectId = "818727", Username = "alice", Password = "alice", 17 | Claims = 18 | { 19 | new Claim(JwtClaimTypes.Name, "Alice Smith"), 20 | new Claim(JwtClaimTypes.GivenName, "Alice"), 21 | new Claim(JwtClaimTypes.FamilyName, "Smith"), 22 | new Claim(JwtClaimTypes.Email, "AliceSmith@email.com"), 23 | new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), 24 | new Claim(JwtClaimTypes.WebSite, "http://alice.com"), 25 | new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json) 26 | } 27 | }, 28 | new TestUser{SubjectId = "88421113", Username = "bob", Password = "bob", 29 | Claims = 30 | { 31 | new Claim(JwtClaimTypes.Name, "Bob Smith"), 32 | new Claim(JwtClaimTypes.GivenName, "Bob"), 33 | new Claim(JwtClaimTypes.FamilyName, "Smith"), 34 | new Claim(JwtClaimTypes.Email, "BobSmith@email.com"), 35 | new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), 36 | new Claim(JwtClaimTypes.WebSite, "http://bob.com"), 37 | new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json), 38 | new Claim("location", "somewhere") 39 | } 40 | } 41 | }; 42 | } 43 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/QuickstartIdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/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 IdentityServer4; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.DependencyInjection; 8 | using Microsoft.IdentityModel.Tokens; 9 | 10 | namespace QuickstartIdentityServer 11 | { 12 | public class Startup 13 | { 14 | public void ConfigureServices(IServiceCollection services) 15 | { 16 | services.AddMvc(); 17 | 18 | // configure identity server with in-memory stores, keys, clients and scopes 19 | services.AddIdentityServer() 20 | .AddDeveloperSigningCredential() 21 | .AddInMemoryIdentityResources(Config.GetIdentityResources()) 22 | .AddInMemoryApiResources(Config.GetApiResources()) 23 | .AddInMemoryClients(Config.GetClients()) 24 | .AddTestUsers(Config.GetUsers()); 25 | 26 | services.AddAuthentication() 27 | .AddGoogle("Google", options => 28 | { 29 | options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme; 30 | 31 | options.ClientId = "434483408261-55tc8n0cs4ff1fe21ea8df2o443v2iuc.apps.googleusercontent.com"; 32 | options.ClientSecret = "3gcoTrEDPPJ0ukn_aYYT6PWo"; 33 | }) 34 | .AddOpenIdConnect("oidc", "OpenID Connect", options => 35 | { 36 | options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme; 37 | options.SignOutScheme = IdentityServerConstants.SignoutScheme; 38 | 39 | options.Authority = "https://demo.identityserver.io/"; 40 | options.ClientId = "implicit"; 41 | 42 | options.TokenValidationParameters = new TokenValidationParameters 43 | { 44 | NameClaimType = "name", 45 | RoleClaimType = "role" 46 | }; 47 | }); 48 | } 49 | 50 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 51 | { 52 | if (env.IsDevelopment()) 53 | { 54 | app.UseDeveloperExceptionPage(); 55 | } 56 | 57 | app.UseIdentityServer(); 58 | 59 | app.UseStaticFiles(); 60 | app.UseMvcWithDefaultRoute(); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Views/Account/LoggedOut.cshtml: -------------------------------------------------------------------------------- 1 | @model LoggedOutViewModel 2 | 3 | @{ 4 | // set this so the layout rendering sees an anonymous user 5 | ViewData["signed-out"] = true; 6 | } 7 | 8 | 27 | 28 | @section scripts 29 | { 30 | @if (Model.AutomaticRedirectAfterSignOut) 31 | { 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /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 |
-------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Views/Consent/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model ConsentViewModel 2 | 3 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Views/Consent/_ScopeListItem.cshtml: -------------------------------------------------------------------------------- 1 | @model ScopeViewModel 2 | 3 |
  • 4 | 24 | @if (Model.Required) 25 | { 26 | (required) 27 | } 28 | @if (Model.Description != null) 29 | { 30 | 33 | } 34 |
  • -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Views/Grants/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model GrantsViewModel 2 | 3 |
    4 | 12 | 13 | @if (Model.Grants.Any() == false) 14 | { 15 |
    16 |
    17 |
    18 | You have not given access to any applications 19 |
    20 |
    21 |
    22 | } 23 | else 24 | { 25 | foreach (var grant in Model.Grants) 26 | { 27 |
    28 |
    29 | @if (grant.ClientLogoUrl != null) 30 | { 31 | 32 | } 33 |
    34 |
    35 |
    @grant.ClientName
    36 |
    37 | Created: @grant.Created.ToString("yyyy-MM-dd") 38 |
    39 | @if (grant.Expires.HasValue) 40 | { 41 |
    42 | Expires: @grant.Expires.Value.ToString("yyyy-MM-dd") 43 |
    44 | } 45 | @if (grant.IdentityGrantNames.Any()) 46 | { 47 |
    48 |
    Identity Grants
    49 |
      50 | @foreach (var name in grant.IdentityGrantNames) 51 | { 52 |
    • @name
    • 53 | } 54 |
    55 |
    56 | } 57 | @if (grant.ApiGrantNames.Any()) 58 | { 59 |
    60 |
    API Grants
    61 |
      62 | @foreach (var name in grant.ApiGrantNames) 63 | { 64 |
    • @name
    • 65 | } 66 |
    67 |
    68 | } 69 |
    70 |
    71 |
    72 | 73 | 74 |
    75 |
    76 |
    77 | } 78 | } 79 |
    -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | 
    2 | 11 | 12 |
    13 |
    14 |

    15 | IdentityServer publishes a 16 | discovery document 17 | where you can find metadata and links to all the endpoints, key material, etc. 18 |

    19 |
    20 |
    21 |

    22 | Click here to manage your stored grants. 23 |

    24 |
    25 |
    26 |
    27 |
    28 |

    29 | Here are links to the 30 | source code repository, 31 | and ready to use samples. 32 |

    33 |
    34 |
    35 |
    36 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Hosting 2 | @model ErrorViewModel 3 | @inject IHostingEnvironment host 4 | 5 | @{ 6 | var error = Model?.Error?.Error; 7 | var errorDescription = host.IsDevelopment() ? Model?.Error?.ErrorDescription : null; 8 | var request_id = Model?.Error?.RequestId; 9 | } 10 | 11 |
    12 | 15 | 16 |
    17 |
    18 |
    19 | Sorry, there was an error 20 | 21 | @if (error != null) 22 | { 23 | 24 | 25 | : @error 26 | 27 | 28 | 29 | if (errorDescription != null) 30 | { 31 |
    @errorDescription
    32 | } 33 | } 34 |
    35 | 36 | @if (request_id != null) 37 | { 38 |
    Request Id: @request_id
    39 | } 40 |
    41 |
    42 |
    43 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer4.Extensions 2 | @{ 3 | string name = null; 4 | if (!true.Equals(ViewData["signed-out"])) 5 | { 6 | name = Context.User?.FindFirst("name")?.Value; 7 | } 8 | } 9 | 10 | 11 | 12 | 13 | 14 | 15 | IdentityServer4 16 | 17 | 18 | 19 | 20 | 21 | 22 | 52 | 53 |
    54 | @RenderBody() 55 |
    56 | 57 | 58 | 59 | @RenderSection("scripts", required: false) 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
    4 | Error 5 |
    6 |
    7 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer4.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/bin/Debug/netcoreapp2.0/QuickstartIdentityServer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/bin/Debug/netcoreapp2.0/QuickstartIdentityServer.dll -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/bin/Debug/netcoreapp2.0/QuickstartIdentityServer.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/bin/Debug/netcoreapp2.0/QuickstartIdentityServer.pdb -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/bin/Debug/netcoreapp2.0/QuickstartIdentityServer.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\solen\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\solen\\.nuget\\packages", 6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/bin/Debug/netcoreapp2.0/QuickstartIdentityServer.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.0", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "2.0.0" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/obj/Debug/netcoreapp2.0/QuickstartIdentityServer.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("QuickstartIdentityServer")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("QuickstartIdentityServer")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("QuickstartIdentityServer")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/obj/Debug/netcoreapp2.0/QuickstartIdentityServer.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 42ee0c48d5a9b4a139a9007338af082a89b60962 2 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/obj/Debug/netcoreapp2.0/QuickstartIdentityServer.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | b1befe63dc3bfc2a95b525b3952170cae5389128 2 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/obj/Debug/netcoreapp2.0/QuickstartIdentityServer.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\bin\Debug\netcoreapp2.0\QuickstartIdentityServer.deps.json 2 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\bin\Debug\netcoreapp2.0\QuickstartIdentityServer.runtimeconfig.json 3 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\bin\Debug\netcoreapp2.0\QuickstartIdentityServer.runtimeconfig.dev.json 4 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\bin\Debug\netcoreapp2.0\QuickstartIdentityServer.dll 5 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\bin\Debug\netcoreapp2.0\QuickstartIdentityServer.pdb 6 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\obj\Debug\netcoreapp2.0\QuickstartIdentityServer.csprojResolveAssemblyReference.cache 7 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\obj\Debug\netcoreapp2.0\QuickstartIdentityServer.csproj.CoreCompileInputs.cache 8 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\obj\Debug\netcoreapp2.0\QuickstartIdentityServer.AssemblyInfoInputs.cache 9 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\obj\Debug\netcoreapp2.0\QuickstartIdentityServer.AssemblyInfo.cs 10 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\obj\Debug\netcoreapp2.0\QuickstartIdentityServer.dll 11 | D:\Projects\DotnetCore\7_JavaScriptClient\src\QuickstartIdentityServer\obj\Debug\netcoreapp2.0\QuickstartIdentityServer.pdb 12 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/obj/Debug/netcoreapp2.0/QuickstartIdentityServer.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/obj/Debug/netcoreapp2.0/QuickstartIdentityServer.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/obj/Debug/netcoreapp2.0/QuickstartIdentityServer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/obj/Debug/netcoreapp2.0/QuickstartIdentityServer.dll -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/obj/Debug/netcoreapp2.0/QuickstartIdentityServer.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/obj/Debug/netcoreapp2.0/QuickstartIdentityServer.pdb -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/obj/QuickstartIdentityServer.csproj.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dgSpecHash": "uWLeqcZkAMHhljkFW7z9u/ssavoab88PQS5xfN2DJxe2Qdhu6pNsFlKL/g16MNLFa+P+tYkvtKRSI9qT6Mwxcg==", 4 | "success": true 5 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/obj/QuickstartIdentityServer.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | True 5 | NuGet 6 | D:\Projects\DotnetCore\JavaScriptClient_CallPythonApi\src\QuickstartIdentityServer\obj\project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\solen\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder 9 | PackageReference 10 | 4.5.0 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/obj/QuickstartIdentityServer.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/tempkey.rsa: -------------------------------------------------------------------------------- 1 | {"KeyId":"2f5b7bb0567f1e5fcffe15ad16a67164","Parameters":{"D":"hY+iaLc2preFDWgmgPIEqZYH1RyInLR51nlbgFVCt64SKD8tOsW0OfNSWiE6UpZPp7bjT58cdKZAZI4z8KUGUnlbQA7dlYxhmIS6AYopOnHytrN4sv/gAwOjVzvezZJfNnFgIODNNmjXXY+pG3ZwXtf3g6ZNVO01EOQvF1t07aTVf0Oh5V9cgEBSdDsb/WOufgYEZw1OOzkNInguTt8dc5W8BiyS5C75cvpDzgvSwternZ/D/bcLA9I6qQwBdIQRjgf/ez0xQXyWsY6lMEpPiQy8s6DPyltwX2ELSUPaeJjoNDqZP9mLQsLJ/zCkUWSIwfM7FYLN6yoOR5iRMHk/CQ==","DP":"ZTtDAcx6IPVDqgCeQZKcJf1LBiQCVhrWxmIy6nxGVwwMi2ohOmeJdLU73VfzmGPk4EpUx2i+mi7UY+BUU4CdFk+Ov0eDx8rDbHKwuk1jt4T6HspSccRSYYx+Yz1fPLxWj8IUMRIrIk8aJf1kHW7tIyAs3hEagTlv2puLX5mSs80=","DQ":"IRGZXTm67BaYDbp0dT+9YA2fIoeqm+m5OisXRtYjAHNcnKhr8nZcp6HgSGs/4/1xI5zIRZoawOq0icgaiPYRl/yvXzxy+O0O2/5C90KG2Qko8D4z0m+VGYKOZBD6DdKx/V9fvJeLPMYPOHgkhCLhH8zekQbqNajgYVgUNAjqPok=","Exponent":"AQAB","InverseQ":"GHWIsphjLWF8AWlxCIHjNpYXAZKRH3RyyowUL0J8bBBXq5fLRZmzFThOZdgp+wY9bb3/jeD1fDwMuCmZhpkamvMmJlM9hbx9e/zzaCSsfZ/fRDFEjhFOGnEn2F/bCoDG8XxBqaAFnb3LSjiyZgY0uXnOyrBYtxJgCalJPBjpU8s=","Modulus":"7W7B9tE79+6jYu78hY1LkAZXxF3sbSP5WquIPY64xjeJmxkbKjLZ9T9YjARraNiPM2POqLO9pA0zcn93/9cM9EMlsDalt1K5xiFgeAW9uuMNIPjClwYI0zxxkcAg8+JBzsG6xPfOf0j+lhGEgCgUeuJy0w6FGTl/MC/Gaqaao188G4l0M8m4q3iYrZcXHLFZQAPxYiKOEil1ciBhZUa/T8qKNnFYZimxssUtk2B8SMRDq8rza0vaO4UeETINz+oE4i73NFD/qqOiYv/huNaMTCpt2be/PwbYUdq8NKJdsOEu5UkayS96RnHB6Mu49/YPcrdV11U6MX4rPoMNS8UfSQ==","P":"8m65YdOLwOgKBXc8seWGDt5jh0c7H2L2Q4zDOEBeLS/MbpjmF7F09FTyH4E793a4/++7nWp+Y+va+xYPajjFCWq1lQDyBIOYHkqftlenSe1X6b1xldTlIdWtyePr9pqbg1OvupxDK8g2h30hDGU0Rj9GYwc+8PnROh/TDVk/FQM=","Q":"+rhmyqoeQxhoYERMwXUAWWkNoLg+p6LNiAF24EspEKeoVmQAUoTj3V13H7wC0hNX0BRA/RvZeGb87zJ5k0Sqh7VZUbwRN8wbRxyE18Q8/u8eP/HnnYn/FastVK7L9Xqaty9rFxRAknWiXsCIXCWXHtwOoI/pJ02JINP6MtqiCsM="}} -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-top: 65px; 3 | } 4 | .navbar-header { 5 | position: relative; 6 | top: -4px; 7 | } 8 | .navbar-brand > .icon-banner { 9 | position: relative; 10 | top: -2px; 11 | display: inline; 12 | } 13 | .icon { 14 | position: relative; 15 | top: -10px; 16 | } 17 | .logged-out iframe { 18 | display: none; 19 | width: 0; 20 | height: 0; 21 | } 22 | .page-consent .client-logo { 23 | float: left; 24 | } 25 | .page-consent .client-logo img { 26 | width: 80px; 27 | height: 80px; 28 | } 29 | .page-consent .consent-buttons { 30 | margin-top: 25px; 31 | } 32 | .page-consent .consent-form .consent-scopecheck { 33 | display: inline-block; 34 | margin-right: 5px; 35 | } 36 | .page-consent .consent-form .consent-description { 37 | margin-left: 25px; 38 | } 39 | .page-consent .consent-form .consent-description label { 40 | font-weight: normal; 41 | } 42 | .page-consent .consent-form .consent-remember { 43 | padding-left: 16px; 44 | } 45 | .grants .page-header { 46 | margin-bottom: 10px; 47 | } 48 | .grants .grant { 49 | margin-top: 20px; 50 | padding-bottom: 20px; 51 | border-bottom: 1px solid lightgray; 52 | } 53 | .grants .grant img { 54 | width: 100px; 55 | height: 100px; 56 | } 57 | .grants .grant .clientname { 58 | font-size: 140%; 59 | font-weight: bold; 60 | } 61 | .grants .grant .granttype { 62 | font-size: 120%; 63 | font-weight: bold; 64 | } 65 | .grants .grant .created { 66 | font-size: 120%; 67 | font-weight: bold; 68 | } 69 | .grants .grant .expires { 70 | font-size: 120%; 71 | font-weight: bold; 72 | } 73 | .grants .grant li { 74 | list-style-type: none; 75 | display: inline; 76 | } 77 | .grants .grant li:after { 78 | content: ', '; 79 | } 80 | .grants .grant li:last-child:after { 81 | content: ''; 82 | } -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/wwwroot/css/site.less: -------------------------------------------------------------------------------- 1 | body { 2 | margin-top: 65px; 3 | } 4 | 5 | .navbar-header { 6 | position: relative; 7 | top: -4px; 8 | } 9 | 10 | .navbar-brand > .icon-banner { 11 | position: relative; 12 | top: -2px; 13 | display: inline; 14 | } 15 | 16 | .icon { 17 | position: relative; 18 | top: -10px; 19 | } 20 | 21 | .logged-out iframe { 22 | display: none; 23 | width: 0; 24 | height: 0; 25 | } 26 | 27 | .page-consent { 28 | .client-logo { 29 | float: left; 30 | 31 | img { 32 | width: 80px; 33 | height: 80px; 34 | } 35 | } 36 | 37 | .consent-buttons { 38 | margin-top: 25px; 39 | } 40 | 41 | .consent-form { 42 | .consent-scopecheck { 43 | display: inline-block; 44 | margin-right: 5px; 45 | } 46 | 47 | .consent-scopecheck[disabled] { 48 | //visibility:hidden; 49 | } 50 | 51 | .consent-description { 52 | margin-left: 25px; 53 | 54 | label { 55 | font-weight: normal; 56 | } 57 | } 58 | 59 | .consent-remember { 60 | padding-left: 16px; 61 | } 62 | } 63 | } 64 | 65 | .grants { 66 | .page-header { 67 | margin-bottom: 10px; 68 | } 69 | 70 | .grant { 71 | margin-top: 20px; 72 | padding-bottom: 20px; 73 | border-bottom: 1px solid lightgray; 74 | 75 | img { 76 | width: 100px; 77 | height: 100px; 78 | } 79 | 80 | .clientname { 81 | font-size: 140%; 82 | font-weight: bold; 83 | } 84 | 85 | .granttype { 86 | font-size: 120%; 87 | font-weight: bold; 88 | } 89 | 90 | .created { 91 | font-size: 120%; 92 | font-weight: bold; 93 | } 94 | 95 | .expires { 96 | font-size: 120%; 97 | font-weight: bold; 98 | } 99 | 100 | li { 101 | list-style-type: none; 102 | display: inline; 103 | 104 | &:after { 105 | content: ', '; 106 | } 107 | 108 | &:last-child:after { 109 | content: ''; 110 | } 111 | 112 | .displayname { 113 | } 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{margin-top:65px;}.navbar-header{position:relative;top:-4px;}.navbar-brand>.icon-banner{position:relative;top:-2px;display:inline;}.icon{position:relative;top:-10px;}.logged-out iframe{display:none;width:0;height:0;}.page-consent .client-logo{float:left;}.page-consent .client-logo img{width:80px;height:80px;}.page-consent .consent-buttons{margin-top:25px;}.page-consent .consent-form .consent-scopecheck{display:inline-block;margin-right:5px;}.page-consent .consent-form .consent-description{margin-left:25px;}.page-consent .consent-form .consent-description label{font-weight:normal;}.page-consent .consent-form .consent-remember{padding-left:16px;}.grants .page-header{margin-bottom:10px;}.grants .grant{margin-top:20px;padding-bottom:20px;border-bottom:1px solid #d3d3d3;}.grants .grant img{width:100px;height:100px;}.grants .grant .clientname{font-size:140%;font-weight:bold;}.grants .grant .granttype{font-size:120%;font-weight:bold;}.grants .grant .created{font-size:120%;font-weight:bold;}.grants .grant .expires{font-size:120%;font-weight:bold;}.grants .grant li{list-style-type:none;display:inline;}.grants .grant li:after{content:', ';}.grants .grant li:last-child:after{content:'';} -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/QuickstartIdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/ResourceOwnerClient/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 IdentityModel.Client; 5 | using Newtonsoft.Json.Linq; 6 | using System; 7 | using System.Net.Http; 8 | using System.Threading.Tasks; 9 | using Newtonsoft.Json; 10 | 11 | namespace ResourceOwnerClient 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) => MainAsync().GetAwaiter().GetResult(); 16 | 17 | private static async Task MainAsync() 18 | { 19 | // discover endpoints from metadata 20 | var disco = await DiscoveryClient.GetAsync("http://localhost:5000"); 21 | 22 | // request token 23 | var tokenClient = new TokenClient(disco.TokenEndpoint, "ro.client", "secret"); 24 | var tokenResponse = await tokenClient.RequestResourceOwnerPasswordAsync("alice", "password", "api1"); 25 | 26 | if (tokenResponse.IsError) 27 | { 28 | Console.WriteLine(tokenResponse.Error); 29 | return; 30 | } 31 | 32 | Console.WriteLine(tokenResponse.Json); 33 | Console.WriteLine("\n\n"); 34 | 35 | // call api 36 | var client = new HttpClient(); 37 | client.SetBearerToken(tokenResponse.AccessToken); 38 | 39 | var response = await client.GetAsync("http://localhost:8000/identity"); 40 | if (!response.IsSuccessStatusCode) 41 | { 42 | Console.WriteLine(response.StatusCode); 43 | } 44 | else 45 | { 46 | var content = response.Content.ReadAsStringAsync().Result; 47 | var obj = JsonConvert.DeserializeObject(content); 48 | Console.WriteLine(obj); 49 | Console.ReadLine(); 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /src/ResourceOwnerClient/ResourceOwnerClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/ResourceOwnerClient/bin/Debug/netcoreapp2.0/ResourceOwnerClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/ResourceOwnerClient/bin/Debug/netcoreapp2.0/ResourceOwnerClient.dll -------------------------------------------------------------------------------- /src/ResourceOwnerClient/bin/Debug/netcoreapp2.0/ResourceOwnerClient.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/ResourceOwnerClient/bin/Debug/netcoreapp2.0/ResourceOwnerClient.pdb -------------------------------------------------------------------------------- /src/ResourceOwnerClient/bin/Debug/netcoreapp2.0/ResourceOwnerClient.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\solen\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\solen\\.nuget\\packages", 6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /src/ResourceOwnerClient/bin/Debug/netcoreapp2.0/ResourceOwnerClient.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.0", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "2.0.0" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/ResourceOwnerClient/obj/Debug/netcoreapp2.0/ResourceOwnerClient.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("ResourceOwnerClient")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("ResourceOwnerClient")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("ResourceOwnerClient")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /src/ResourceOwnerClient/obj/Debug/netcoreapp2.0/ResourceOwnerClient.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 0ddea5b251a9c90bcd7b18e23ed36c6a45c4d909 2 | -------------------------------------------------------------------------------- /src/ResourceOwnerClient/obj/Debug/netcoreapp2.0/ResourceOwnerClient.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | e5d2c3e83f9835a99c447b50caae01cf103542f4 2 | -------------------------------------------------------------------------------- /src/ResourceOwnerClient/obj/Debug/netcoreapp2.0/ResourceOwnerClient.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\bin\Debug\netcoreapp2.0\ResourceOwnerClient.deps.json 2 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\bin\Debug\netcoreapp2.0\ResourceOwnerClient.runtimeconfig.json 3 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\bin\Debug\netcoreapp2.0\ResourceOwnerClient.runtimeconfig.dev.json 4 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\bin\Debug\netcoreapp2.0\ResourceOwnerClient.dll 5 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\bin\Debug\netcoreapp2.0\ResourceOwnerClient.pdb 6 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\obj\Debug\netcoreapp2.0\ResourceOwnerClient.csprojResolveAssemblyReference.cache 7 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\obj\Debug\netcoreapp2.0\ResourceOwnerClient.csproj.CoreCompileInputs.cache 8 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\obj\Debug\netcoreapp2.0\ResourceOwnerClient.AssemblyInfoInputs.cache 9 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\obj\Debug\netcoreapp2.0\ResourceOwnerClient.AssemblyInfo.cs 10 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\obj\Debug\netcoreapp2.0\ResourceOwnerClient.dll 11 | D:\Projects\DotnetCore\7_JavaScriptClient\src\ResourceOwnerClient\obj\Debug\netcoreapp2.0\ResourceOwnerClient.pdb 12 | -------------------------------------------------------------------------------- /src/ResourceOwnerClient/obj/Debug/netcoreapp2.0/ResourceOwnerClient.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/ResourceOwnerClient/obj/Debug/netcoreapp2.0/ResourceOwnerClient.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /src/ResourceOwnerClient/obj/Debug/netcoreapp2.0/ResourceOwnerClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/ResourceOwnerClient/obj/Debug/netcoreapp2.0/ResourceOwnerClient.dll -------------------------------------------------------------------------------- /src/ResourceOwnerClient/obj/Debug/netcoreapp2.0/ResourceOwnerClient.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solenovex/Identity-Server-4-Python-Hug-Api-Jwks/d9b18c7a16c8c36ed969ccf308769ff66b23e57f/src/ResourceOwnerClient/obj/Debug/netcoreapp2.0/ResourceOwnerClient.pdb -------------------------------------------------------------------------------- /src/ResourceOwnerClient/obj/ResourceOwnerClient.csproj.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dgSpecHash": "TVckk1hWzFpzHO3S+1YxABdTFYMi3j3qr5xzleSiFbfIlsJmTOCfqaWllE2HRGjpWf4oiehg90RzalhMuu+HOQ==", 4 | "success": true 5 | } -------------------------------------------------------------------------------- /src/ResourceOwnerClient/obj/ResourceOwnerClient.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | True 5 | NuGet 6 | D:\Projects\DotnetCore\JavaScriptClient_CallPythonApi\src\ResourceOwnerClient\obj\project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\solen\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder 9 | PackageReference 10 | 4.5.0 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/ResourceOwnerClient/obj/ResourceOwnerClient.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | 7 | 8 | 9 | 10 | --------------------------------------------------------------------------------