├── ServiceStack ├── Punchcard.Angular1JWT │ ├── .bowerrc │ ├── src │ │ ├── client │ │ │ ├── app │ │ │ │ ├── Claims │ │ │ │ │ ├── claims.module.js │ │ │ │ │ ├── config.route.js │ │ │ │ │ ├── claims.html │ │ │ │ │ └── claims.js │ │ │ │ ├── layout │ │ │ │ │ ├── layout.module.js │ │ │ │ │ ├── sidebar.html │ │ │ │ │ ├── shell.html │ │ │ │ │ ├── topnav.html │ │ │ │ │ ├── sidebar.js │ │ │ │ │ └── shell.js │ │ │ │ ├── widgets │ │ │ │ │ ├── widgets.module.js │ │ │ │ │ ├── widgetheader.html │ │ │ │ │ ├── ccSpinner.js │ │ │ │ │ ├── ccWidgetClose.js │ │ │ │ │ ├── ccWidgetHeader.js │ │ │ │ │ ├── ccWidgetMinimize.js │ │ │ │ │ └── ccSidebar.js │ │ │ │ ├── blocks │ │ │ │ │ ├── logger │ │ │ │ │ │ ├── logger.module.js │ │ │ │ │ │ └── logger.js │ │ │ │ │ ├── exception │ │ │ │ │ │ ├── exception.module.js │ │ │ │ │ │ ├── exception.js │ │ │ │ │ │ └── exception-handler.provider.js │ │ │ │ │ └── router │ │ │ │ │ │ ├── router.module.js │ │ │ │ │ │ └── routehelper.js │ │ │ │ ├── dashboard │ │ │ │ │ ├── dashboard.module.js │ │ │ │ │ ├── dashboard.html │ │ │ │ │ ├── dashboard.js │ │ │ │ │ └── config.route.js │ │ │ │ ├── core │ │ │ │ │ ├── constants.js │ │ │ │ │ ├── core.module.js │ │ │ │ │ ├── config.js │ │ │ │ │ ├── AuthService.js │ │ │ │ │ └── dataservice.js │ │ │ │ └── app.module.js │ │ │ ├── content │ │ │ │ └── images │ │ │ │ │ ├── gg.png │ │ │ │ │ ├── busy.gif │ │ │ │ │ ├── gruntjs.jpg │ │ │ │ │ ├── avengersicon.png │ │ │ │ │ ├── AngularJS-small.png │ │ │ │ │ └── avengersicon-xs.png │ │ │ ├── callback.html │ │ │ ├── test │ │ │ │ ├── midway │ │ │ │ │ ├── view-requests.spec.js │ │ │ │ │ ├── template.spec.js │ │ │ │ │ ├── dataservice.spec.js │ │ │ │ │ └── controller.spec.js │ │ │ │ ├── specs │ │ │ │ │ ├── avengers-route.spec.js │ │ │ │ │ ├── dashboard-route.spec.js │ │ │ │ │ ├── avengers.spec.js │ │ │ │ │ ├── sidebar.spec.js │ │ │ │ │ ├── dashboard.spec.js │ │ │ │ │ ├── exception-handler.provider.spec.js │ │ │ │ │ └── dataservice.spec.js │ │ │ │ ├── lib │ │ │ │ │ ├── bindPolyfill.js │ │ │ │ │ ├── mockData.js │ │ │ │ │ └── specHelper.js │ │ │ │ └── .jshintrc │ │ │ └── index.html │ │ └── server │ │ │ ├── favicon.ico │ │ │ ├── routes │ │ │ ├── index.js │ │ │ └── utils │ │ │ │ ├── jsonfileservice.js │ │ │ │ └── errorHandler.js │ │ │ └── app.js │ ├── packages.config │ ├── gulp │ │ ├── commentWrapper.js │ │ ├── copyright.js │ │ └── common.js │ ├── bower.json │ ├── iisnode.yml │ ├── .gitignore │ ├── Web.config │ ├── Web.Debug.config │ ├── .jshintrc │ ├── Web.Release.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── gulp.config.json │ ├── package.json │ ├── .jscsrc │ └── karma.conf.js ├── Punchard.ServiceStackJWTExample │ ├── default.html │ ├── Global.asax │ ├── Global.asax.cs │ ├── packages.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── AppHost.cs │ └── Web.config ├── Punchard.ServiceStackJWTExample.ServiceModel │ ├── HelloAuth.cs │ ├── packages.config │ ├── Hello.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Punchard.ServiceStackJWTExample.ServiceModel.csproj ├── Punchard.ServiceStackJWTExample.ServiceInterface │ ├── MyServices.cs │ ├── app.config │ ├── MyServicesAuth.cs │ ├── packages.config │ └── Properties │ │ └── AssemblyInfo.cs ├── Punchcard.ServiceStackJWT │ ├── app.config │ ├── packages.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── JsonWebToken.cs │ └── JsonWebTokenAuthProvider.cs ├── Punchard.ServiceStackJWTExample.Tests │ ├── app.config │ ├── packages.config │ ├── UnitTests.cs │ └── Properties │ │ └── AssemblyInfo.cs └── Punchard.ServiceStackJWT.sln ├── IdentityServer_aspcore └── IdSvrHost │ ├── UI │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Error │ │ ├── ErrorViewModel.cs │ │ └── ErrorController.cs │ ├── SharedViews │ │ ├── _ValidationSummary.cshtml │ │ ├── Error.cshtml │ │ └── _Layout.cshtml │ ├── Logout │ │ ├── LogoutViewModel.cs │ │ ├── Views │ │ │ ├── LoggedOut.cshtml │ │ │ └── Index.cshtml │ │ ├── LoggedOutViewModel.cs │ │ └── LogoutController.cs │ ├── Consent │ │ ├── ConsentInputModel.cs │ │ ├── Views │ │ │ ├── _ScopeListItem.cshtml │ │ │ └── Index.cshtml │ │ ├── ConsentResult.cs │ │ ├── ConsentViewModel.cs │ │ └── ConsentController.cs │ ├── Home │ │ ├── HomeController.cs │ │ └── Views │ │ │ └── Index.cshtml │ ├── Login │ │ ├── LoginInputModel.cs │ │ ├── LoginViewModel.cs │ │ ├── SignInResult.cs │ │ ├── LoginService.cs │ │ ├── Views │ │ │ └── Index.cshtml │ │ └── LoginController.cs │ ├── CustomViewLocationExpander.cs │ └── TagHelpers │ │ └── HideShowTagHelpers.cs │ ├── idsrv4test.pfx │ ├── wwwroot │ ├── icon.jpg │ ├── icon.png │ ├── favicon.ico │ ├── lib │ │ └── bootstrap │ │ │ └── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ ├── web.config │ └── css │ │ ├── site.min.css │ │ ├── site.css │ │ └── site.less │ ├── appsettings.json │ ├── Properties │ └── launchSettings.json │ ├── IdSvrHost.xproj │ ├── Configuration │ ├── Scopes.cs │ └── Users.cs │ ├── Extensions │ └── CustomGrantValidator.cs │ ├── project.json │ └── Startup.cs ├── README.md ├── LICENSE └── .gitignore /ServiceStack/Punchcard.Angular1JWT/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components" 3 | } -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample/default.html: -------------------------------------------------------------------------------- 1 | This project hosts the API and that is all. 2 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" 2 | @addTagHelper "*, IdSvrHost" 3 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/idsrv4test.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/IdentityServer_aspcore/IdSvrHost/idsrv4test.pfx -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/IdentityServer_aspcore/IdSvrHost/wwwroot/icon.jpg -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/IdentityServer_aspcore/IdSvrHost/wwwroot/icon.png -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/IdentityServer_aspcore/IdSvrHost/wwwroot/favicon.ico -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Punchard.ServiceStackJWTExample.Global" Language="C#" %> 2 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/Claims/claims.module.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('app.claims', []); 5 | })(); 6 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/layout/layout.module.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('app.layout', []); 5 | })(); 6 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/widgets/widgets.module.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('app.widgets', []); 5 | })(); 6 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/server/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/ServiceStack/Punchcard.Angular1JWT/src/server/favicon.ico -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/blocks/logger/logger.module.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('blocks.logger', []); 5 | })(); 6 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/dashboard/dashboard.module.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('app.dashboard', []); 5 | })(); 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ServiceStackJWT 2 | [http://estynedwards.com/blog/2016/01/30/ServiceStack-IdentityServer-Angular/](http://estynedwards.com/blog/2016/01/30/ServiceStack-IdentityServer-Angular/) 3 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/content/images/gg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/ServiceStack/Punchcard.Angular1JWT/src/client/content/images/gg.png -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/content/images/busy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/ServiceStack/Punchcard.Angular1JWT/src/client/content/images/busy.gif -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/content/images/gruntjs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/ServiceStack/Punchcard.Angular1JWT/src/client/content/images/gruntjs.jpg -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/blocks/exception/exception.module.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('blocks.exception', ['blocks.logger']); 5 | })(); 6 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/content/images/avengersicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/ServiceStack/Punchcard.Angular1JWT/src/client/content/images/avengersicon.png -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/content/images/AngularJS-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/ServiceStack/Punchcard.Angular1JWT/src/client/content/images/AngularJS-small.png -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/content/images/avengersicon-xs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/ServiceStack/Punchcard.Angular1JWT/src/client/content/images/avengersicon-xs.png -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/IdentityServer_aspcore/IdSvrHost/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/IdentityServer_aspcore/IdSvrHost/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/blocks/router/router.module.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('blocks.router', [ 5 | 'ngRoute', 6 | 'blocks.logger' 7 | ]); 8 | })(); 9 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/IdentityServer_aspcore/IdSvrHost/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Estyn/ServiceStackJWT/HEAD/IdentityServer_aspcore/IdSvrHost/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Error/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using IdentityServer4.Core.Models; 2 | 3 | namespace IdSvrHost.UI.Error 4 | { 5 | public class ErrorViewModel 6 | { 7 | public ErrorMessage Error { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/SharedViews/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 |
2 | Error 3 |
4 |
5 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationInsights": { 3 | "InstrumentationKey": "" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Verbose", 9 | "System": "Information", 10 | "Microsoft": "Information" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Logout/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace IdSvrHost.UI.Logout 7 | { 8 | public class LogoutViewModel 9 | { 10 | public string SignOutId { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample.ServiceModel/HelloAuth.cs: -------------------------------------------------------------------------------- 1 | using ServiceStack; 2 | 3 | namespace Punchard.ServiceStackJWTExample.ServiceModel 4 | { 5 | [Route("/helloAuth/{Name}")] 6 | public class HelloAuth : IReturn 7 | { 8 | public string Name { get; set; } 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Punchard.ServiceStackJWTExample 4 | { 5 | public class Global : System.Web.HttpApplication 6 | { 7 | protected void Application_Start(object sender, EventArgs e) 8 | { 9 | new AppHost().Init(); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/core/constants.js: -------------------------------------------------------------------------------- 1 | /* global toastr:false, moment:false */ 2 | (function() { 3 | 'use strict'; 4 | 5 | angular 6 | .module('app.core') 7 | .constant('toastr', toastr) 8 | .constant('moment', moment) 9 | .constant('globalConfig', { baseUrl: 'http://localhost:14096/' }); 10 | })(); 11 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample.ServiceModel/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace IdSvrHost.UI.Consent 7 | { 8 | public class ConsentInputModel 9 | { 10 | public IEnumerable ScopesConsented { get; set; } 11 | public bool RememberConsent { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/gulp/commentWrapper.js: -------------------------------------------------------------------------------- 1 | (function (commentWrapper) { 2 | 3 | commentWrapper.wrap = wrap; 4 | 5 | function wrap(comments) { 6 | var output = '/*\n'; 7 | comments.forEach(function (line) { 8 | output = output + '* ' + line + '\n'; 9 | }); 10 | output = output + '*/\n'; 11 | return output; 12 | } 13 | 14 | })(module.exports) -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/dashboard/dashboard.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | This is the dashboard 7 |
8 |
9 | 10 |
11 |
12 |
-------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Home/HomeController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.Mvc; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace IdSvrHost.UI.Home 8 | { 9 | public class HomeController : Controller 10 | { 11 | [Route("/")] 12 | public IActionResult Index() 13 | { 14 | return View(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Login/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace IdSvrHost.UI.Login 4 | { 5 | public class LoginInputModel 6 | { 7 | [Required] 8 | public string Username { get; set; } 9 | [Required] 10 | public string Password { get; set; } 11 | public bool RememberLogin { get; set; } 12 | public string SignInId { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample.ServiceInterface/MyServices.cs: -------------------------------------------------------------------------------- 1 | using Punchard.ServiceStackJWTExample.ServiceModel; 2 | using ServiceStack; 3 | 4 | namespace Punchard.ServiceStackJWT.ServiceInterface 5 | { 6 | public class MyServices : Service 7 | { 8 | public object Any(Hello request) 9 | { 10 | return new HelloResponse { Result = "Hello, {0}!".Fmt(request.Name) }; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/wwwroot/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/widgets/widgetheader.html: -------------------------------------------------------------------------------- 1 |
2 |
{{title}}
3 | ({{subtitle}}) 4 |
5 | 6 |
7 | {{rightText}} 8 |
9 |
-------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/gulp/copyright.js: -------------------------------------------------------------------------------- 1 | //     .pipe(plug.header(fs.readFileSync('./gulp/copyright.js'), {version: pkg.version})) 2 | 3 | /** 4 | * @author John Papa 5 | * @version: 6 | * <%= version %> 7 | * @links 8 | * http://github.com/johnpapa/ng-demos 9 | * http://twitter.com/johnpapa 10 | * http://johnpapa.net 11 | * @source 12 | * http://github.com/johnpapa/ng-demos 13 | * @license: 14 | * MIT License http://www.opensource.org/licenses/mit-license.php 15 | */ -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/core/core.module.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('app.core', [ 5 | /* 6 | * Angular modules 7 | */ 8 | 'ngAnimate', 'ngRoute', 'ngSanitize', 9 | /* 10 | * Our reusable cross app code modules 11 | */ 12 | 'blocks.exception', 'blocks.logger', 'blocks.router', 13 | /* 14 | * 3rd Party modules 15 | */ 16 | 'ngplus' 17 | ]); 18 | })(); 19 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample.ServiceModel/Hello.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using ServiceStack; 3 | 4 | namespace Punchard.ServiceStackJWTExample.ServiceModel 5 | { 6 | [Route("/hello/{Name}")] 7 | public class Hello : IReturn 8 | { 9 | public string Name { get; set; } 10 | } 11 | 12 | public class HelloResponse 13 | { 14 | public string Result { get; set; } 15 | public List Claims { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /ServiceStack/Punchcard.ServiceStackJWT/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample.Tests/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Login/LoginViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace IdSvrHost.UI.Login 2 | { 3 | public class LoginViewModel : LoginInputModel 4 | { 5 | public LoginViewModel() 6 | { 7 | } 8 | 9 | public LoginViewModel(LoginInputModel other) 10 | { 11 | Username = other.Username; 12 | Password = other.Password; 13 | RememberLogin = other.RememberLogin; 14 | SignInId = other.SignInId; 15 | } 16 | 17 | public string ErrorMessage { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample.ServiceInterface/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/server/routes/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function(app) { 2 | var jsonfileservice = require('./utils/jsonfileservice')(); 3 | 4 | app.get('/api/maa', getMaa); 5 | 6 | function getMaa(req, res, next) { 7 | var json = jsonfileservice.getJsonFromFile('/../../data/maa.json'); 8 | json[0].data.results.forEach(function(character) { 9 | var pos = character.name.indexOf('(MAA)'); 10 | character.name = character.name.substr(0, pos - 1); 11 | }); 12 | res.send(json); 13 | } 14 | }; -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/blocks/exception/exception.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('blocks.exception') 6 | .factory('exception', exception); 7 | 8 | /* @ngInject */ 9 | function exception(logger) { 10 | var service = { 11 | catcher: catcher 12 | }; 13 | return service; 14 | 15 | function catcher(message) { 16 | return function(reason) { 17 | logger.error(message, reason); 18 | }; 19 | } 20 | } 21 | })(); -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Logout/Views/LoggedOut.cshtml: -------------------------------------------------------------------------------- 1 | @model IdSvrHost.UI.Logout.LoggedOutViewModel 2 | 3 | 19 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample.Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/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;}.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;} -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Logout/LoggedOutViewModel.cs: -------------------------------------------------------------------------------- 1 | using IdentityServer4.Core.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace IdSvrHost.UI.Logout 8 | { 9 | public class LoggedOutViewModel 10 | { 11 | public LoggedOutViewModel() 12 | { 13 | SignOutIFrameUrls = Enumerable.Empty(); 14 | } 15 | 16 | public ClientReturnInfo ReturnInfo { get; set; } 17 | public string ClientName { get; set; } 18 | 19 | public IEnumerable SignOutIFrameUrls { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/CustomViewLocationExpander.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNet.Mvc.Razor; 2 | using System.Collections.Generic; 3 | 4 | namespace IdSvrHost.UI 5 | { 6 | public class CustomViewLocationExpander : IViewLocationExpander 7 | { 8 | public IEnumerable ExpandViewLocations( 9 | ViewLocationExpanderContext context, 10 | IEnumerable viewLocations) 11 | { 12 | yield return "~/UI/{1}/Views/{0}.cshtml"; 13 | yield return "~/UI/SharedViews/{0}.cshtml"; 14 | } 15 | 16 | public void PopulateValues(ViewLocationExpanderContext context) 17 | { 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/layout/sidebar.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 14 |
15 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Logout/Views/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IdSvrHost.UI.Logout.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 |
-------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/dashboard/dashboard.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('app.dashboard') 6 | .controller('Dashboard', Dashboard); 7 | 8 | Dashboard.$inject = ['$q', 'dataservice', 'logger']; 9 | 10 | function Dashboard($q, dataservice, logger) { 11 | 12 | /*jshint validthis: true */ 13 | var vm = this; 14 | 15 | 16 | vm.title = 'Dashboard'; 17 | 18 | init(); 19 | 20 | function init() { 21 | var promises = []; 22 | // 23 | return $q.all(promises).then(function() { 24 | logger.info('Activated Dashboard View'); 25 | }); 26 | } 27 | 28 | 29 | } 30 | })(); 31 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:22530/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "launchUrl": "http://localhost:22530/", 15 | "environmentVariables": { 16 | "Hosting:Environment": "Development" 17 | }, 18 | "sdkVersion": "dnx-clr-win-x86.1.0.0-rc1-final" 19 | }, 20 | "web": { 21 | "commandName": "web", 22 | "environmentVariables": { 23 | "Hosting:Environment": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/app.module.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('app', [ 5 | /* 6 | * Order is not important. Angular makes a 7 | * pass to register all of the modules listed 8 | * and then when app.dashboard tries to use app.data, 9 | * its components are available. 10 | */ 11 | 12 | /* 13 | * Everybody has access to these. 14 | * We could place these under every feature area, 15 | * but this is easier to maintain. 16 | */ 17 | 'app.core', 18 | 'app.widgets', 19 | 20 | /* 21 | * Feature areas 22 | */ 23 | 24 | 'app.dashboard', 25 | 'app.layout', 26 | 'app.claims' 27 | ]); 28 | 29 | })(); 30 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/server/routes/utils/jsonfileservice.js: -------------------------------------------------------------------------------- 1 | module.exports = function() { 2 | var service = { 3 | getJsonFromFile: getJsonFromFile 4 | }; 5 | return service; 6 | 7 | function getJsonFromFile(file) { 8 | var fs = require('fs'); 9 | var json = getConfig(file); 10 | return json; 11 | 12 | function readJsonFileSync(filepath, encoding) { 13 | if (typeof (encoding) === 'undefined') { 14 | encoding = 'utf8'; 15 | } 16 | var file = fs.readFileSync(filepath, encoding); 17 | return JSON.parse(file); 18 | } 19 | 20 | function getConfig(file) { 21 | var filepath = __dirname + file; 22 | return readJsonFileSync(filepath); 23 | } 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/server/routes/utils/errorHandler.js: -------------------------------------------------------------------------------- 1 | module.exports = function() { 2 | var service = { 3 | init: init, 4 | logErrors: logErrors 5 | }; 6 | return service; 7 | 8 | function init(err, req, res, next) { 9 | var status = err.statusCode || 500; 10 | if (err.message) { 11 | res.send(status, err.message); 12 | } else { 13 | res.send(status, err); 14 | } 15 | next(); 16 | } 17 | 18 | /* Our fall through error logger and errorHandler */ 19 | function logErrors(err, req, res, next) { 20 | var status = err.statusCode || 500; 21 | console.error(status + ' ' + (err.message ? err.message : err)); 22 | if (err.stack) { 23 | console.error(err.stack); 24 | } 25 | next(err); 26 | } 27 | }; -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AngularJS Modular Demo", 3 | "version": "0.0.1", 4 | "description": "AngularJS Modular Demo", 5 | "authors": [ 6 | "John Papa" 7 | ], 8 | "license": "MIT", 9 | "homepage": "https://github.com/johnpapa/ng-demos", 10 | "ignore": [ 11 | "**/.*", 12 | "node_modules", 13 | "bower_components", 14 | "test", 15 | "tests" 16 | ], 17 | "devDependencies": { 18 | "angular-mocks": "~1.2.24" 19 | }, 20 | "dependencies": { 21 | "angular": "~1.2.24", 22 | "toastr": "~2.0.1", 23 | "bootstrap": "~3.1.1", 24 | "moment": "~2.6.0", 25 | "jquery": "~2.1.0", 26 | "angular-route": "~1.2.24", 27 | "angular-animate": "~1.2.24", 28 | "angular-sanitize": "~1.2.24", 29 | "font-awesome": "~4.0.3", 30 | "extras.angular.plus": "~0.9.0", 31 | "oidc-token-manager": "~1.0.1" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Login/SignInResult.cs: -------------------------------------------------------------------------------- 1 | using IdentityServer4.Core.Services; 2 | using Microsoft.AspNet.Mvc; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace IdSvrHost.UI.Login 10 | { 11 | public class SignInResult : IActionResult 12 | { 13 | private readonly string _requestId; 14 | 15 | public SignInResult(string requestId) 16 | { 17 | _requestId = requestId; 18 | } 19 | 20 | public async Task ExecuteResultAsync(ActionContext context) 21 | { 22 | var interaction = context.HttpContext.RequestServices.GetRequiredService(); 23 | await interaction.ProcessResponseAsync(_requestId, new IdentityServer4.Core.Models.SignInResponse()); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/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 | .page-consent .client-logo { 18 | float: left; 19 | } 20 | .page-consent .client-logo img { 21 | width: 80px; 22 | height: 80px; 23 | } 24 | .page-consent .consent-buttons { 25 | margin-top: 25px; 26 | } 27 | .page-consent .consent-form .consent-scopecheck { 28 | display: inline-block; 29 | margin-right: 5px; 30 | } 31 | .page-consent .consent-form .consent-description { 32 | margin-left: 25px; 33 | } 34 | .page-consent .consent-form .consent-description label { 35 | font-weight: normal; 36 | } 37 | .page-consent .consent-form .consent-remember { 38 | padding-left: 16px; 39 | } -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/callback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/test/midway/view-requests.spec.js: -------------------------------------------------------------------------------- 1 | describe('Midway: view requests', function() { 2 | var tester; 3 | beforeEach(function() { 4 | if (tester) { 5 | tester.destroy(); 6 | } 7 | tester = ngMidwayTester('app'); 8 | }); 9 | 10 | beforeEach(function() { 11 | module('app', specHelper.fakeLogger); 12 | }); 13 | 14 | it('should goto the dashboard by default', function(done) { 15 | tester.visit('/', function() { 16 | expect(tester.viewElement().html()).to.contain('id="dashboard-view"'); 17 | done(); 18 | }); 19 | }); 20 | 21 | it('should have a working avengers request', function(done) { 22 | tester.visit('/avengers', function() { 23 | expect(tester.viewElement().html()).to.contain('title="Avengers"'); 24 | done(); 25 | }); 26 | }); 27 | }); -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/Claims/config.route.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('app.claims') 6 | .run(appRun); 7 | 8 | // appRun.$inject = ['routehelper'] 9 | 10 | /* @ngInject */ 11 | function appRun(routehelper) { 12 | routehelper.configureRoutes(getRoutes()); 13 | } 14 | 15 | function getRoutes() { 16 | return [ 17 | { 18 | url: '/claims', 19 | config: { 20 | templateUrl: 'app/claims/claims.html', 21 | controller: 'Claims', 22 | controllerAs: 'vm', 23 | title: 'claims', 24 | settings: { 25 | nav: 2, 26 | content: ' Claims' 27 | } 28 | } 29 | } 30 | ]; 31 | } 32 | })(); 33 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/SharedViews/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model IdSvrHost.UI.Error.ErrorViewModel 2 | 3 | @{ 4 | var error_description = Model?.Error?.ErrorDescription ?? "Sorry, there was an unexpected error."; 5 | var error_code = Model?.Error?.ErrorCode; 6 | var request_id = Model?.Error?.RequestId; 7 | } 8 | 9 |
10 | 13 | 14 |
15 |
16 |
17 | 18 | 19 | @Model.Error.ErrorCode 20 | 21 | 22 | 23 | @error_description 24 |
25 | 26 |
Request Id: @request_id
27 |
28 |
29 |
30 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/dashboard/config.route.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('app.dashboard') 6 | .run(appRun); 7 | 8 | // appRun.$inject = ['routehelper']; 9 | 10 | /* @ngInject */ 11 | function appRun(routehelper) { 12 | routehelper.configureRoutes(getRoutes()); 13 | } 14 | 15 | function getRoutes() { 16 | return [ 17 | { 18 | url: '/', 19 | config: { 20 | templateUrl: 'app/dashboard/dashboard.html', 21 | controller: 'Dashboard', 22 | controllerAs: 'vm', 23 | title: 'dashboard', 24 | settings: { 25 | nav: 1, 26 | content: ' Dashboard' 27 | } 28 | } 29 | } 30 | ]; 31 | } 32 | })(); 33 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/iisnode.yml: -------------------------------------------------------------------------------- 1 | # For documentation see https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/iisnode.yml 2 | 3 | loggingEnabled: true 4 | debuggingEnabled: true 5 | devErrorsEnabled: true 6 | node_env: development 7 | nodeProcessCountPerApplication: 1 8 | maxConcurrentRequestsPerProcess: 1024 9 | maxNamedPipeConnectionRetry: 24 10 | namedPipeConnectionRetryDelay: 250 11 | maxNamedPipeConnectionPoolSize: 512 12 | maxNamedPipePooledConnectionAge: 30000 13 | asyncCompletionThreadCount: 0 14 | initialRequestBufferSize: 4096 15 | maxRequestBufferSize: 65536 16 | watchedFiles: *.js;iisnode.yml;node_modules\* 17 | uncFileChangesPollingInterval: 5000 18 | gracefulShutdownTimeout: 60000 19 | logDirectoryNameSuffix: logs 20 | debuggerPortRange: 5058-6058 21 | debuggerPathSegment: debug 22 | maxLogFileSizeInKB: 128 23 | appendToExistingLog: false 24 | logFileFlushInterval: 5000 25 | flushResponse: false 26 | enableXFF: false 27 | promoteServerVars: -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Login/LoginService.cs: -------------------------------------------------------------------------------- 1 | using IdentityServer4.Core.Services.InMemory; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | 5 | namespace IdSvrHost.UI.Login 6 | { 7 | public class LoginService 8 | { 9 | private readonly List _users; 10 | 11 | public LoginService(List users) 12 | { 13 | _users = users; 14 | } 15 | 16 | public bool ValidateCredentials(string username, string password) 17 | { 18 | var user = FindByUsername(username); 19 | if (user != null) 20 | { 21 | return user.Password.Equals(password); 22 | } 23 | return false; 24 | } 25 | 26 | public InMemoryUser FindByUsername(string username) 27 | { 28 | return _users.FirstOrDefault(x=>x.Username.Equals(username, System.StringComparison.OrdinalIgnoreCase)); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/test/specs/avengers-route.spec.js: -------------------------------------------------------------------------------- 1 | /* jshint -W117, -W030 */ 2 | describe('avengers', function () { 3 | describe('route', function () { 4 | var controller; 5 | 6 | beforeEach(function() { 7 | module('app', specHelper.fakeLogger); 8 | specHelper.injector(function($httpBackend, $location, $rootScope, $route) {}); 9 | $httpBackend.expectGET('app/avengers/avengers.html').respond(200); 10 | }); 11 | 12 | it('should map /avengers route to avengers View template', function () { 13 | expect($route.routes['/avengers'].templateUrl). 14 | to.equal('app/avengers/avengers.html'); 15 | }); 16 | 17 | it('should route / to the avengers View', function () { 18 | $location.path('/avengers'); 19 | $rootScope.$apply(); 20 | expect($route.current.templateUrl).to.equal('app/avengers/avengers.html'); 21 | }); 22 | }); 23 | }); -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Consent/Views/_ScopeListItem.cshtml: -------------------------------------------------------------------------------- 1 | @model IdSvrHost.UI.Consent.ScopeViewModel 2 | 3 |
  • 4 | 19 | (required) 20 | 23 |
  • -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Consent/ConsentResult.cs: -------------------------------------------------------------------------------- 1 | using IdentityServer4.Core.Models; 2 | using IdentityServer4.Core.Services; 3 | using Microsoft.AspNet.Mvc; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace IdSvrHost.UI.Consent 11 | { 12 | public class ConsentResult : IActionResult 13 | { 14 | private readonly string _requestId; 15 | private readonly ConsentResponse _response; 16 | 17 | public ConsentResult(string requestId, ConsentResponse response) 18 | { 19 | _requestId = requestId; 20 | _response = response; 21 | } 22 | 23 | public async Task ExecuteResultAsync(ActionContext context) 24 | { 25 | var interaction = context.HttpContext.RequestServices.GetRequiredService(); 26 | await interaction.ProcessResponseAsync(_requestId, _response); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample.ServiceInterface/MyServicesAuth.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | using System.Security.Claims; 4 | using System.Web; 5 | using Punchard.ServiceStackJWTExample.ServiceModel; 6 | using ServiceStack; 7 | 8 | namespace Punchard.ServiceStackJWT.ServiceInterface 9 | { 10 | public class MyServicesAuth : Service 11 | { 12 | [Authenticate] 13 | public object Any(HelloAuth request) 14 | 15 | { 16 | Debug.Write(HttpContext.Current.User.Identity.Name); 17 | var x = new HelloResponse { Result = "Hello, {0}!".Fmt(request.Name) }; 18 | var identity = (ClaimsIdentity)HttpContext.Current.User.Identity; 19 | var claims = identity.Claims; 20 | 21 | x.Claims = new List(); 22 | foreach (var claim in claims) 23 | { 24 | x.Claims.Add(claim.Type+" : "+claim.Value); 25 | } 26 | return x; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/widgets/ccSpinner.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('app.widgets') 6 | .directive('ccSpinner', ccSpinner); 7 | 8 | // ccSpinner.$inject = ['$window']; 9 | 10 | /* @ngInject */ 11 | function ccSpinner ($window) { 12 | // Description: 13 | // Creates a new Spinner and sets its options 14 | // Usage: 15 | //
    16 | var directive = { 17 | link: link, 18 | restrict: 'A' 19 | }; 20 | return directive; 21 | 22 | function link(scope, element, attrs) { 23 | scope.spinner = null; 24 | scope.$watch(attrs.ccSpinner, function(options) { 25 | if (scope.spinner) { 26 | scope.spinner.stop(); 27 | } 28 | scope.spinner = new $window.Spinner(options); 29 | scope.spinner.spin(element[0]); 30 | }, true); 31 | } 32 | } 33 | })(); 34 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/widgets/ccWidgetClose.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('app.widgets') 6 | .directive('ccWidgetClose', ccWidgetClose); 7 | 8 | /* @ngInject */ 9 | function ccWidgetClose () { 10 | // Usage: 11 | // 12 | // Creates: 13 | // 14 | // 15 | // 16 | var directive = { 17 | link: link, 18 | template: '', 19 | restrict: 'A' 20 | }; 21 | return directive; 22 | 23 | function link(scope, element, attrs) { 24 | attrs.$set('href', '#'); 25 | attrs.$set('wclose'); 26 | element.click(closeEl); 27 | 28 | function closeEl(e) { 29 | e.preventDefault(); 30 | element.parent().parent().parent().hide(100); 31 | } 32 | } 33 | } 34 | })(); 35 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.ServiceStackJWT/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/layout/shell.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 | Modular Demo 6 |
    7 |
    8 |
    9 | 10 |
    11 |
    12 |
    13 |
    14 |
    15 | 16 |
    17 | 18 |
    22 | 23 | 24 |
    {{vm.busyMessage}}
    25 |
    26 |
    27 |
    28 | 29 | 30 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/widgets/ccWidgetHeader.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('app.widgets') 6 | .directive('ccWidgetHeader', ccWidgetHeader); 7 | 8 | /* @ngInject */ 9 | function ccWidgetHeader () { 10 | //Usage: 11 | //
    12 | // Creates: 13 | //
    16 | var directive = { 17 | // link: link, 18 | scope: { 19 | 'title': '@', 20 | 'subtitle': '@', 21 | 'rightText': '@', 22 | 'allowCollapse': '@' 23 | }, 24 | templateUrl: 'app/widgets/widgetheader.html', 25 | restrict: 'A' 26 | }; 27 | return directive; 28 | 29 | // function link(scope, element, attrs) { 30 | // attrs.$set('class', 'widget-head'); 31 | // } 32 | } 33 | })(); 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 e 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 all 13 | 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 THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Error/ErrorController.cs: -------------------------------------------------------------------------------- 1 | using IdentityServer4.Core; 2 | using IdentityServer4.Core.Services; 3 | using Microsoft.AspNet.Mvc; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace IdSvrHost.UI.Error 10 | { 11 | public class ErrorController : Controller 12 | { 13 | private readonly ErrorInteraction _errorInteraction; 14 | 15 | public ErrorController(ErrorInteraction errorInteraction) 16 | { 17 | _errorInteraction = errorInteraction; 18 | } 19 | 20 | [Route(Constants.RoutePaths.Error, Name ="Error")] 21 | public async Task Index(string id) 22 | { 23 | var vm = new ErrorViewModel(); 24 | 25 | if (id != null) 26 | { 27 | var message = await _errorInteraction.GetRequestAsync(id); 28 | if (message != null) 29 | { 30 | vm.Error = message; 31 | } 32 | } 33 | 34 | return View("Error", vm); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/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 | .page-consent { 22 | .client-logo { 23 | float: left; 24 | 25 | img { 26 | width: 80px; 27 | height: 80px; 28 | } 29 | } 30 | 31 | .consent-buttons { 32 | margin-top: 25px; 33 | } 34 | 35 | .consent-form { 36 | .consent-scopecheck { 37 | display: inline-block; 38 | margin-right: 5px; 39 | } 40 | 41 | .consent-scopecheck[disabled] { 42 | //visibility:hidden; 43 | } 44 | 45 | .consent-description { 46 | margin-left: 25px; 47 | 48 | label { 49 | font-weight: normal; 50 | } 51 | } 52 | 53 | .consent-remember { 54 | padding-left: 16px; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/gulp/common.js: -------------------------------------------------------------------------------- 1 | (function (common) { 2 | var commentWrapper = require('./commentWrapper.js'); 3 | 4 | common.createComments = createComments; 5 | common.formatPercent = formatPercent; 6 | common.bytediffFormatter = bytediffFormatter; 7 | 8 | function bytediffFormatter(data) { 9 | var difference = (data.savings > 0) ? ' smaller.' : ' larger.'; 10 | return data.fileName + ' went from ' 11 | + (data.startSize / 1000).toFixed(2) + ' kB to ' + (data.endSize / 1000).toFixed(2) + ' kB' 12 | + ' and is ' + common.formatPercent(1-data.percent, 2) + '%' + difference; 13 | } 14 | 15 | // Create standard comments header for minified files 16 | function createComments(gutil) { 17 | var comments = [ 18 | 'John Papa', 19 | 'Copyright 2014', 20 | 'MIT License', 21 | 'Compiled on ' + gutil.date('mmm d, yyyy h:MM:ss TT Z') 22 | ]; 23 | return commentWrapper.wrap(comments); 24 | } 25 | 26 | function formatPercent(num, precision){ 27 | return (num*100).toFixed(precision); 28 | } 29 | 30 | })(module.exports) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Visual Studio Project # 2 | ################### 3 | *.user 4 | *.gpState 5 | *.suo 6 | **/bin 7 | **/obj 8 | /packages 9 | /WevAPI_aspcore 10 | 11 | # Ignore Node & Bower 12 | ################### 13 | **/node_modules 14 | /modular/client/build 15 | /modular/build 16 | **/bower_components 17 | **/test/coverage 18 | /reports 19 | 20 | 21 | # mongo db 22 | ################### 23 | #Don't commit Mongo Database files 24 | *.lock 25 | *.0 26 | *.1 27 | *.ns 28 | journal 29 | 30 | # Ignore Web Storm # 31 | .idea 32 | 33 | # Compiled source # 34 | ################### 35 | *.com 36 | *.class 37 | *.dll 38 | *.exe 39 | *.o 40 | *.so 41 | report/ 42 | 43 | # Packages # 44 | ############ 45 | # it's better to unpack these files and commit the raw source 46 | # git has its own built in compression methods 47 | *.7z 48 | *.dmg 49 | *.gz 50 | *.iso 51 | *.jar 52 | *.rar 53 | *.tar 54 | *.xap 55 | *.zip 56 | 57 | # Logs and databases # 58 | ###################### 59 | *.log 60 | *.sql 61 | *.sqlite 62 | # *.sdf 63 | *.mdf 64 | *.ldf 65 | 66 | # OS generated files # 67 | ###################### 68 | .DS_Store* 69 | ehthumbs.db 70 | Icon? 71 | Thumbs.db 72 | packages 73 | 74 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Visual Studio Project # 2 | ################### 3 | *.user 4 | *.gpState 5 | *.suo 6 | bin 7 | obj 8 | /packages 9 | 10 | # Ignore Node & Bower 11 | ################### 12 | node_modules 13 | /modular/client/build 14 | /modular/build 15 | bower_components 16 | **/test/coverage 17 | /reports 18 | 19 | 20 | # mongo db 21 | ################### 22 | #Don't commit Mongo Database files 23 | *.lock 24 | *.0 25 | *.1 26 | *.ns 27 | journal 28 | 29 | # Ignore Web Storm # 30 | .idea 31 | 32 | # Compiled source # 33 | ################### 34 | *.com 35 | *.class 36 | *.dll 37 | *.exe 38 | *.o 39 | *.so 40 | report/ 41 | 42 | # Packages # 43 | ############ 44 | # it's better to unpack these files and commit the raw source 45 | # git has its own built in compression methods 46 | *.7z 47 | *.dmg 48 | *.gz 49 | *.iso 50 | *.jar 51 | *.rar 52 | *.tar 53 | *.xap 54 | *.zip 55 | 56 | # Logs and databases # 57 | ###################### 58 | *.log 59 | *.sql 60 | *.sqlite 61 | # *.sdf 62 | *.mdf 63 | *.ldf 64 | 65 | # OS generated files # 66 | ###################### 67 | .DS_Store* 68 | ehthumbs.db 69 | Icon? 70 | Thumbs.db 71 | packages 72 | 73 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/layout/topnav.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Home/Views/Index.cshtml: -------------------------------------------------------------------------------- 1 | 2 |
    3 | 12 | 13 |
    14 |
    15 |

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

    20 |
    21 |
    22 |
    23 |
    24 |

    25 | Here are links to the 26 | source code repository, 27 | and ready to use samples. 28 |

    29 |
    30 |
    31 |
    32 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/test/midway/template.spec.js: -------------------------------------------------------------------------------- 1 | describe('Midway: templates', function() { 2 | it('should load the template for the avengers view properly', 3 | function(done) { 4 | var tester = ngMidwayTester('app'); 5 | tester.visit('/avengers', function() { 6 | var current = tester.inject('$route').current; 7 | var controller = current.controller; 8 | var template = current.templateUrl; 9 | expect(template).to.match(/avengers\/avengers\.html/); 10 | tester.destroy(); 11 | done(); 12 | }); 13 | }); 14 | 15 | it('should load the template for the dashboard view properly', 16 | function(done) { 17 | var tester = ngMidwayTester('app'); 18 | tester.visit('/', function() { 19 | var current = tester.inject('$route').current; 20 | var controller = current.controller; 21 | var template = current.templateUrl; 22 | expect(template).to.match(/dashboard\/dashboard\.html/); 23 | tester.destroy(); 24 | done(); 25 | }); 26 | }); 27 | }); -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/test/specs/dashboard-route.spec.js: -------------------------------------------------------------------------------- 1 | /* jshint -W117, -W030 */ 2 | describe('dashboard', function () { 3 | describe('route', function () { 4 | var controller; 5 | 6 | beforeEach(function() { 7 | module('app', specHelper.fakeLogger); 8 | specHelper.injector(function($httpBackend, $location, $rootScope, $route) {}); 9 | $httpBackend.expectGET('app/dashboard/dashboard.html').respond(200); 10 | }); 11 | 12 | it('should map / route to dashboard View template', function () { 13 | expect($route.routes['/'].templateUrl). 14 | to.equal('app/dashboard/dashboard.html'); 15 | }); 16 | 17 | it('should route / to the dashboard View', function () { 18 | $location.path('/'); 19 | $rootScope.$digest(); 20 | expect($route.current.templateUrl).to.equal('app/dashboard/dashboard.html'); 21 | }); 22 | 23 | it('should route /invalid to the otherwise (dashboard) route', function () { 24 | $location.path('/invalid'); 25 | $rootScope.$digest(); 26 | expect($route.current.templateUrl).to.equal('app/dashboard/dashboard.html'); 27 | }); 28 | }); 29 | }); -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/layout/sidebar.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('app.layout') 6 | .controller('Sidebar', Sidebar); 7 | 8 | Sidebar.$inject = ['$route', 'routehelper']; 9 | 10 | function Sidebar($route, routehelper) { 11 | /*jshint validthis: true */ 12 | var vm = this; 13 | var routes = routehelper.getRoutes(); 14 | vm.isCurrent = isCurrent; 15 | //vm.sidebarReady = function(){console.log('done animating menu')}; // example 16 | 17 | activate(); 18 | 19 | function activate() { getNavRoutes(); } 20 | 21 | function getNavRoutes() { 22 | vm.navRoutes = routes.filter(function(r) { 23 | return r.settings && r.settings.nav; 24 | }).sort(function(r1, r2) { 25 | return r1.settings.nav - r2.settings.nav; 26 | }); 27 | } 28 | 29 | function isCurrent(route) { 30 | if (!route.title || !$route.current || !$route.current.title) { 31 | return ''; 32 | } 33 | var menuName = route.title; 34 | return $route.current.title.substr(0, menuName.length) === menuName ? 'current' : ''; 35 | } 36 | } 37 | })(); 38 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample.Tests/UnitTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Punchard.ServiceStackJWT.ServiceInterface; 3 | using Punchard.ServiceStackJWTExample.ServiceModel; 4 | using ServiceStack; 5 | using ServiceStack.Testing; 6 | 7 | namespace Punchard.ServiceStackJWTExample.Tests 8 | { 9 | [TestFixture] 10 | public class UnitTests 11 | { 12 | private readonly ServiceStackHost appHost; 13 | 14 | public UnitTests() 15 | { 16 | appHost = new BasicAppHost(typeof(MyServices).Assembly) 17 | { 18 | ConfigureContainer = container => 19 | { 20 | //Add your IoC dependencies here 21 | } 22 | } 23 | .Init(); 24 | } 25 | 26 | [TestFixtureTearDown] 27 | public void TestFixtureTearDown() 28 | { 29 | appHost.Dispose(); 30 | } 31 | 32 | [Test] 33 | public void TestMethod1() 34 | { 35 | var service = appHost.Container.Resolve(); 36 | 37 | var response = (HelloResponse)service.Any(new Hello { Name = "World" }); 38 | 39 | Assert.That(response.Result, Is.EqualTo("Hello, World!")); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample.ServiceInterface/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/IdSvrHost.xproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | 154ccedc-cfd5-4b7a-9000-fc454ea86362 10 | IdSvrHost 11 | ..\..\artifacts\obj\$(MSBuildProjectName) 12 | ..\..\artifacts\bin\$(MSBuildProjectName)\ 13 | 14 | 15 | 2.0 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/UI/Logout/LogoutController.cs: -------------------------------------------------------------------------------- 1 | using IdentityServer4.Core; 2 | using IdentityServer4.Core.Services; 3 | using Microsoft.AspNet.Mvc; 4 | using System.Linq; 5 | using System.Security.Claims; 6 | using System.Threading.Tasks; 7 | 8 | namespace IdSvrHost.UI.Logout 9 | { 10 | public class LogoutController : Controller 11 | { 12 | private readonly SignOutInteraction _signOutInteraction; 13 | 14 | public LogoutController(SignOutInteraction signOutInteraction) 15 | { 16 | _signOutInteraction = signOutInteraction; 17 | } 18 | 19 | [HttpGet(Constants.RoutePaths.Logout, Name = "Logout")] 20 | public IActionResult Index(string id) 21 | { 22 | return View(new LogoutViewModel { SignOutId = id }); 23 | } 24 | 25 | [HttpPost(Constants.RoutePaths.Logout)] 26 | [ValidateAntiForgeryToken] 27 | public async Task Submit(string signOutId) 28 | { 29 | await HttpContext.Authentication.SignOutAsync(Constants.PrimaryAuthenticationType); 30 | 31 | // set this so UI rendering sees an anonymous user 32 | HttpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 33 | 34 | var vm = new LoggedOutViewModel(); 35 | return View("LoggedOut", vm); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/blocks/logger/logger.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('blocks.logger') 6 | .factory('logger', logger); 7 | 8 | logger.$inject = ['$log', 'toastr']; 9 | 10 | function logger($log, toastr) { 11 | var service = { 12 | showToasts: true, 13 | 14 | error : error, 15 | info : info, 16 | success : success, 17 | warning : warning, 18 | 19 | // straight to console; bypass toastr 20 | log : $log.log 21 | }; 22 | 23 | return service; 24 | ///////////////////// 25 | 26 | function error(message, data, title) { 27 | toastr.error(message, title); 28 | $log.error('Error: ' + message, data); 29 | } 30 | 31 | function info(message, data, title) { 32 | toastr.info(message, title); 33 | $log.info('Info: ' + message, data); 34 | } 35 | 36 | function success(message, data, title) { 37 | toastr.success(message, title); 38 | $log.info('Success: ' + message, data); 39 | } 40 | 41 | function warning(message, data, title) { 42 | toastr.warning(message, title); 43 | $log.warn('Warning: ' + message, data); 44 | } 45 | } 46 | }()); 47 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/test/lib/bindPolyfill.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Phantom.js does not support Function.prototype.bind (at least not before v.2.0 3 | * That's just crazy. Everybody supports bind. 4 | * Read about it here: https://groups.google.com/forum/#!msg/phantomjs/r0hPOmnCUpc/uxusqsl2LNoJ 5 | * This polyfill is copied directly from MDN 6 | * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Compatibility 7 | */ 8 | if (!Function.prototype.bind) { 9 | /*jshint freeze: false */ 10 | Function.prototype.bind = function (oThis) { 11 | if (typeof this !== 'function') { 12 | // closest thing possible to the ECMAScript 5 13 | // internal IsCallable function 14 | throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); 15 | } 16 | 17 | var aArgs = Array.prototype.slice.call(arguments, 1), 18 | fToBind = this, 19 | FuncNoOp = function () {}, 20 | fBound = function () { 21 | return fToBind.apply(this instanceof FuncNoOp && oThis ? this : oThis, 22 | aArgs.concat(Array.prototype.slice.call(arguments))); 23 | }; 24 | 25 | FuncNoOp.prototype = this.prototype; 26 | fBound.prototype = new FuncNoOp(); 27 | 28 | return fBound; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/test/midway/dataservice.spec.js: -------------------------------------------------------------------------------- 1 | describe('Midway: dataservice requests', function() { 2 | var dataservice; 3 | var tester; 4 | 5 | beforeEach(function() { 6 | if (tester) { 7 | tester.destroy(); 8 | } 9 | tester = ngMidwayTester('app'); 10 | }); 11 | 12 | beforeEach(function() { 13 | dataservice = tester.inject('dataservice'); 14 | expect(dataservice).not.to.equal(null); 15 | }); 16 | 17 | describe('getAvengers function', function () { 18 | it('should return 7 Avengers', function (done) { 19 | dataservice.getAvengers().then(function(data) { 20 | expect(data).not.to.equal(null); 21 | expect(data.length).to.equal(7); 22 | done(); 23 | }); 24 | // $rootScope.$apply(); 25 | }); 26 | 27 | it('should contain Black Widow', function (done) { 28 | dataservice.getAvengers().then(function(data) { 29 | expect(data).not.to.equal(null); 30 | var hasBlackWidow = data.some(function isPrime(element, index, array) { 31 | return element.name.indexOf('Black Widow') >= 0; 32 | }); 33 | expect(hasBlackWidow).to.be.true; 34 | done(); 35 | }); 36 | // $rootScope.$apply(); 37 | }); 38 | }); 39 | 40 | }); -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/layout/shell.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('app.layout') 6 | .controller('Shell', Shell); 7 | 8 | Shell.$inject = ['$timeout', 'config', 'logger', 'authService']; 9 | 10 | function Shell($timeout, config, logger, authService) { 11 | /*jshint validthis: true */ 12 | var vm = this; 13 | 14 | vm.title = config.appTitle; 15 | vm.busyMessage = 'Please wait ...'; 16 | vm.isBusy = true; 17 | vm.showSplash = true; 18 | //vm.userName = authService.OidcTokenManager().profile.name; 19 | 20 | activate(); 21 | 22 | function activate() { 23 | logger.success(config.appTitle + ' loaded!', null); 24 | // Using a resolver on all routes or dataservice.ready in every controller 25 | // dataservice.ready().then(function(){ 26 | // hideSplash(); 27 | // }); 28 | vm.mgr = authService.OidcTokenManager(); 29 | if (vm.mgr.expired) { 30 | vm.mgr.redirectForToken(); 31 | } 32 | 33 | hideSplash(); 34 | } 35 | 36 | function hideSplash() { 37 | //Force a 1 second delay so we can see the splash. 38 | $timeout(function() { 39 | vm.showSplash = false; 40 | }, 1000); 41 | } 42 | } 43 | })(); 44 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "camelcase": true, 4 | "curly": true, 5 | "eqeqeq": true, 6 | "es3": false, 7 | "forin": true, 8 | "freeze": true, 9 | "immed": true, 10 | "indent": 4, 11 | "latedef": "nofunc", 12 | "newcap": true, 13 | "noarg": true, 14 | "noempty": true, 15 | "nonbsp": true, 16 | "nonew": true, 17 | "plusplus": false, 18 | "quotmark": "single", 19 | "undef": true, 20 | "unused": false, 21 | "strict": false, 22 | "maxparams": 10, 23 | "maxdepth": 5, 24 | "maxstatements": 40, 25 | "maxcomplexity": 8, 26 | "maxlen": 120, 27 | 28 | "asi": false, 29 | "boss": false, 30 | "debug": false, 31 | "eqnull": true, 32 | "esnext": false, 33 | "evil": false, 34 | "expr": false, 35 | "funcscope": false, 36 | "globalstrict": false, 37 | "iterator": false, 38 | "lastsemic": false, 39 | "laxbreak": false, 40 | "laxcomma": false, 41 | "loopfunc": true, 42 | "maxerr": false, 43 | "moz": false, 44 | "multistr": false, 45 | "notypeof": false, 46 | "proto": false, 47 | "scripturl": false, 48 | "shadow": false, 49 | "sub": true, 50 | "supernew": false, 51 | "validthis": false, 52 | "noyield": false, 53 | 54 | "browser": true, 55 | "node": true, 56 | 57 | "globals": { 58 | "angular": false, 59 | "$": false 60 | } 61 | } -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/test/midway/controller.spec.js: -------------------------------------------------------------------------------- 1 | //http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html 2 | //https://github.com/yearofmoo-articles/AngularJS-Testing-Article 3 | describe('Midway: controllers and routes', function() { 4 | var tester; 5 | beforeEach(function() { 6 | if (tester) { 7 | tester.destroy(); 8 | } 9 | tester = ngMidwayTester('app'); 10 | }); 11 | 12 | beforeEach(function () { 13 | module('app', specHelper.fakeLogger); 14 | }); 15 | 16 | it('should load the Avengers controller properly when /avengers route is accessed', function(done) { 17 | tester.visit('/avengers', function() { 18 | expect(tester.path()).to.equal('/avengers'); 19 | var current = tester.inject('$route').current; 20 | var controller = current.controller; 21 | var scope = current.scope; 22 | expect(controller).to.equal('Avengers'); 23 | done(); 24 | }); 25 | }); 26 | 27 | it('should load the Dashboard controller properly when / route is accessed', function(done) { 28 | tester.visit('/', function() { 29 | expect(tester.path()).to.equal('/'); 30 | var current = tester.inject('$route').current; 31 | var controller = current.controller; 32 | var scope = current.scope; 33 | expect(controller).to.equal('Dashboard'); 34 | done(); 35 | }); 36 | }); 37 | 38 | }); -------------------------------------------------------------------------------- /IdentityServer_aspcore/IdSvrHost/Configuration/Scopes.cs: -------------------------------------------------------------------------------- 1 | using IdentityServer4.Core.Models; 2 | using System.Collections.Generic; 3 | 4 | namespace IdSvrHost.Configuration 5 | { 6 | public class Scopes 7 | { 8 | public static IEnumerable Get() 9 | { 10 | return new List 11 | { 12 | StandardScopes.OpenId, 13 | StandardScopes.ProfileAlwaysInclude, 14 | StandardScopes.EmailAlwaysInclude, 15 | StandardScopes.OfflineAccess, 16 | StandardScopes.RolesAlwaysInclude, 17 | 18 | new Scope 19 | { 20 | Name = "api1", 21 | DisplayName = "API 1", 22 | Description = "API 1 features and data", 23 | Type = ScopeType.Resource, 24 | 25 | ScopeSecrets = new List 26 | { 27 | new Secret("secret".Sha256()) 28 | }, 29 | Claims = new List 30 | { 31 | new ScopeClaim("role") 32 | } 33 | }, 34 | new Scope 35 | { 36 | Name = "api2", 37 | DisplayName = "API 2", 38 | Description = "API 2 features and data, which are better than API 1", 39 | Type = ScopeType.Resource 40 | } 41 | }; 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Punchcard.Angular1JWT")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Punchcard.Angular1JWT")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4cfc2bc0-c0b0-4ac4-8dae-1fc4c22eff40")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/widgets/ccWidgetMinimize.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('app.widgets') 6 | .directive('ccWidgetMinimize', ccWidgetMinimize); 7 | 8 | /* @ngInject */ 9 | function ccWidgetMinimize () { 10 | // Usage: 11 | // 12 | // Creates: 13 | // 14 | var directive = { 15 | link: link, 16 | template: '', 17 | restrict: 'A' 18 | }; 19 | return directive; 20 | 21 | function link(scope, element, attrs) { 22 | //$('body').on('click', '.widget .wminimize', minimize); 23 | attrs.$set('href', '#'); 24 | attrs.$set('wminimize'); 25 | element.click(minimize); 26 | 27 | function minimize(e) { 28 | e.preventDefault(); 29 | var $wcontent = element.parent().parent().next('.widget-content'); 30 | var iElement = element.children('i'); 31 | if ($wcontent.is(':visible')) { 32 | iElement.removeClass('fa fa-chevron-up'); 33 | iElement.addClass('fa fa-chevron-down'); 34 | } else { 35 | iElement.removeClass('fa fa-chevron-down'); 36 | iElement.addClass('fa fa-chevron-up'); 37 | } 38 | $wcontent.toggle(500); 39 | } 40 | } 41 | } 42 | })(); 43 | -------------------------------------------------------------------------------- /ServiceStack/Punchard.ServiceStackJWTExample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Punchard.AngularServiceStack")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Punchard.AngularServiceStack")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6b974b71-9b26-48dc-961f-3071afd7e297")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.ServiceStackJWT/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Punchcard.ServiceStackJWT")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Punchcard.ServiceStackJWT")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("65782666-7e93-40ea-bdd3-e74c06ef93fa")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ServiceStack/Punchcard.Angular1JWT/src/client/app/widgets/ccSidebar.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('app.widgets') 6 | .directive('ccSidebar', ccSidebar); 7 | 8 | /* @ngInject */ 9 | function ccSidebar () { 10 | // Opens and closes the sidebar menu. 11 | // Usage: 12 | //
    13 | //
    14 | // Creates: 15 | //