├── AngularOIDC ├── src │ ├── assets │ │ ├── .gitkeep │ │ ├── favicon.ico │ │ └── img │ │ │ ├── avatars │ │ │ ├── 1.jpg │ │ │ ├── 2.jpg │ │ │ ├── 3.jpg │ │ │ ├── 4.jpg │ │ │ ├── 5.jpg │ │ │ ├── 6.jpg │ │ │ ├── 7.jpg │ │ │ └── 8.jpg │ │ │ └── brand │ │ │ ├── sygnet.svg │ │ │ └── logo.svg │ ├── app │ │ ├── app.component.css │ │ ├── views │ │ │ ├── cotacao │ │ │ │ ├── cotacao.component.scss │ │ │ │ ├── cotacao.module.ts │ │ │ │ ├── cotacao.component.ts │ │ │ │ ├── cotacao.service.ts │ │ │ │ └── cotacao.component.html │ │ │ ├── error │ │ │ │ ├── 404.component.ts │ │ │ │ ├── 500.component.ts │ │ │ │ ├── 404.component.html │ │ │ │ └── 500.component.html │ │ │ ├── base │ │ │ │ ├── cards.component.ts │ │ │ │ ├── tabs.component.ts │ │ │ │ ├── tables.component.ts │ │ │ │ ├── switches.component.ts │ │ │ │ ├── collapses.component.ts │ │ │ │ ├── tooltips.component.ts │ │ │ │ ├── popovers.component.ts │ │ │ │ ├── forms.component.ts │ │ │ │ ├── paginations.component.ts │ │ │ │ ├── carousels.component.ts │ │ │ │ ├── collapses.component.html │ │ │ │ ├── progress.component.ts │ │ │ │ ├── base.module.ts │ │ │ │ ├── progress.component.html │ │ │ │ ├── base-routing.module.ts │ │ │ │ └── paginations.component.html │ │ │ ├── icons │ │ │ │ ├── flags.component.ts │ │ │ │ ├── coreui-icons.component.ts │ │ │ │ ├── font-awesome.component.ts │ │ │ │ ├── simple-line-icons.component.ts │ │ │ │ ├── icons.module.ts │ │ │ │ └── icons-routing.module.ts │ │ │ ├── buttons │ │ │ │ ├── buttons.component.ts │ │ │ │ ├── brand-buttons.component.ts │ │ │ │ ├── buttons.module.ts │ │ │ │ ├── dropdowns.component.ts │ │ │ │ └── buttons-routing.module.ts │ │ │ ├── notifications │ │ │ │ ├── badges.component.ts │ │ │ │ ├── modals.component.ts │ │ │ │ ├── notifications.module.ts │ │ │ │ ├── notifications-routing.module.ts │ │ │ │ ├── alerts.component.ts │ │ │ │ └── badges.component.html │ │ │ ├── theme │ │ │ │ ├── typography.component.ts │ │ │ │ ├── theme.module.ts │ │ │ │ ├── theme-routing.module.ts │ │ │ │ └── colors.component.ts │ │ │ ├── unauthorized │ │ │ │ ├── unauthorized.component.ts │ │ │ │ └── unauthorized.component.html │ │ │ ├── register │ │ │ │ ├── register.component.ts │ │ │ │ └── register.component.html │ │ │ ├── login │ │ │ │ ├── login.component.ts │ │ │ │ ├── login-callback.component.ts │ │ │ │ └── login.component.html │ │ │ ├── chartjs │ │ │ │ ├── chartjs.module.ts │ │ │ │ ├── chartjs-routing.module.ts │ │ │ │ ├── chartjs.component.ts │ │ │ │ └── chartjs.component.html │ │ │ ├── widgets │ │ │ │ ├── widgets-routing.module.ts │ │ │ │ └── widgets.module.ts │ │ │ └── dashboard │ │ │ │ ├── dashboard-routing.module.ts │ │ │ │ └── dashboard.module.ts │ │ ├── containers │ │ │ ├── index.ts │ │ │ └── default-layout │ │ │ │ ├── index.ts │ │ │ │ └── default-layout.component.ts │ │ ├── shared │ │ │ └── models │ │ │ │ └── moedas.model.ts │ │ ├── core │ │ │ └── auth │ │ │ │ ├── auth.config.ts │ │ │ │ └── auth.guard.ts │ │ ├── app.component.spec.ts │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routing.ts │ │ └── _nav.ts │ ├── scss │ │ ├── _variables.scss │ │ ├── _custom.scss │ │ ├── vendors │ │ │ ├── _variables.scss │ │ │ └── chart.js │ │ │ │ └── chart.scss │ │ └── style.scss │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── typings.d.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ ├── main.ts │ ├── test.ts │ ├── index.html │ └── polyfills.ts ├── e2e │ ├── tsconfig.e2e.json │ ├── app.po.ts │ └── app.e2e-spec.ts ├── .editorconfig ├── tsconfig.json ├── protractor.conf.js ├── karma.conf.js ├── package.json ├── tslint.json └── angular.json ├── IdentityServer4AngularOIDC ├── wwwroot │ ├── js │ │ ├── site.min.js │ │ ├── signin-redirect.js │ │ ├── signout-redirect.js │ │ └── site.js │ ├── 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 │ │ │ ├── dist │ │ │ │ ├── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ │ └── npm.js │ │ │ ├── .bower.json │ │ │ └── LICENSE │ │ ├── jquery-validation-unobtrusive │ │ │ ├── .bower.json │ │ │ └── LICENSE.txt │ │ ├── jquery │ │ │ ├── .bower.json │ │ │ └── LICENSE.txt │ │ └── jquery-validation │ │ │ ├── .bower.json │ │ │ └── LICENSE.md │ └── css │ │ ├── site.min.css │ │ ├── site.css │ │ └── site.less ├── Views │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Home │ │ ├── Privacy.cshtml │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ ├── _ValidationSummary.cshtml │ │ ├── Redirect.cshtml │ │ ├── Error.cshtml │ │ ├── _ValidationScriptsPartial.cshtml │ │ ├── _CookieConsentPartial.cshtml │ │ └── _Layout.cshtml │ ├── Account │ │ ├── Logout.cshtml │ │ ├── LoggedOut.cshtml │ │ └── Login.cshtml │ ├── Diagnostics │ │ └── Index.cshtml │ ├── Consent │ │ ├── _ScopeListItem.cshtml │ │ └── Index.cshtml │ └── Grants │ │ └── Index.cshtml ├── appsettings.json ├── appsettings.Development.json ├── Quickstart │ ├── Account │ │ ├── LogoutInputModel.cs │ │ ├── RedirectViewModel.cs │ │ ├── LogoutViewModel.cs │ │ ├── ExternalProvider.cs │ │ ├── LoginInputModel.cs │ │ ├── LoggedOutViewModel.cs │ │ ├── LoginViewModel.cs │ │ └── AccountOptions.cs │ ├── Home │ │ ├── ErrorViewModel.cs │ │ └── HomeController.cs │ ├── Consent │ │ ├── ConsentInputModel.cs │ │ ├── ScopeViewModel.cs │ │ ├── ProcessConsentResult.cs │ │ ├── ConsentViewModel.cs │ │ └── ConsentOptions.cs │ ├── Extensions.cs │ ├── Grants │ │ ├── GrantsViewModel.cs │ │ └── GrantsController.cs │ ├── Diagnostics │ │ ├── DiagnosticsController.cs │ │ └── DiagnosticsViewModel.cs │ ├── TestUsers.cs │ └── SecurityHeadersAttribute.cs ├── Server.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── tempkey.rsa ├── Startup.cs └── Config.cs ├── xa9vfeliritv.png ├── identityserver4-with-oidc-angular.png ├── ProtectedResources ├── appsettings.json ├── appsettings.Development.json ├── ProtectedResources.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── Model │ └── MoedaViewModel.cs ├── Controllers │ └── CotacaoController.cs └── Startup.cs ├── README.md ├── LICENSE ├── IdentityServer4AngularOIDC.sln └── .gitattributes /AngularOIDC/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/cotacao/cotacao.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AngularOIDC/src/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | // Variable overrides 2 | -------------------------------------------------------------------------------- /AngularOIDC/src/scss/_custom.scss: -------------------------------------------------------------------------------- 1 | // Here you can add other styles 2 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/containers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './default-layout'; 2 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/containers/default-layout/index.ts: -------------------------------------------------------------------------------- 1 | export * from './default-layout.component'; 2 | -------------------------------------------------------------------------------- /xa9vfeliritv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/xa9vfeliritv.png -------------------------------------------------------------------------------- /AngularOIDC/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /AngularOIDC/src/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/AngularOIDC/src/assets/favicon.ico -------------------------------------------------------------------------------- /AngularOIDC/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer4.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /identityserver4-with-oidc-angular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/identityserver4-with-oidc-angular.png -------------------------------------------------------------------------------- /AngularOIDC/src/assets/img/avatars/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/AngularOIDC/src/assets/img/avatars/1.jpg -------------------------------------------------------------------------------- /AngularOIDC/src/assets/img/avatars/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/AngularOIDC/src/assets/img/avatars/2.jpg -------------------------------------------------------------------------------- /AngularOIDC/src/assets/img/avatars/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/AngularOIDC/src/assets/img/avatars/3.jpg -------------------------------------------------------------------------------- /AngularOIDC/src/assets/img/avatars/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/AngularOIDC/src/assets/img/avatars/4.jpg -------------------------------------------------------------------------------- /AngularOIDC/src/assets/img/avatars/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/AngularOIDC/src/assets/img/avatars/5.jpg -------------------------------------------------------------------------------- /AngularOIDC/src/assets/img/avatars/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/AngularOIDC/src/assets/img/avatars/6.jpg -------------------------------------------------------------------------------- /AngularOIDC/src/assets/img/avatars/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/AngularOIDC/src/assets/img/avatars/7.jpg -------------------------------------------------------------------------------- /AngularOIDC/src/assets/img/avatars/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/AngularOIDC/src/assets/img/avatars/8.jpg -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/icon.jpg -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/icon.png -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/js/signin-redirect.js: -------------------------------------------------------------------------------- 1 | window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); 2 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/favicon.ico -------------------------------------------------------------------------------- /ProtectedResources/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /AngularOIDC/src/scss/vendors/_variables.scss: -------------------------------------------------------------------------------- 1 | // Override Boostrap variables 2 | @import "../variables"; 3 | @import "node_modules/bootstrap/scss/mixins"; 4 | @import "node_modules/@coreui/coreui/scss/variables"; 5 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/shared/models/moedas.model.ts: -------------------------------------------------------------------------------- 1 | export class Moedas { 2 | public id: number; 3 | public nome: string; 4 | public simbolo: string; 5 | public rank: number; 6 | public preco: number; 7 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /ProtectedResources/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/error/404.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: '404.component.html' 5 | }) 6 | export class P404Component { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/error/500.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: '500.component.html' 5 | }) 6 | export class P500Component { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/cards.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'cards.component.html' 5 | }) 6 | export class CardsComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/tabs.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'tabs.component.html' 5 | }) 6 | export class TabsComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/icons/flags.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'flags.component.html' 5 | }) 6 | export class FlagsComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /AngularOIDC/src/scss/style.scss: -------------------------------------------------------------------------------- 1 | // If you want to override variables do it here 2 | @import "variables"; 3 | 4 | // Import styles 5 | @import "~@coreui/coreui/scss/coreui"; 6 | 7 | // If you want to add something do it here 8 | @import "custom"; 9 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/tables.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'tables.component.html' 5 | }) 6 | export class TablesComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/switches.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'switches.component.html' 5 | }) 6 | export class SwitchesComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/buttons/buttons.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'buttons.component.html' 5 | }) 6 | export class ButtonsComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/notifications/badges.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'badges.component.html' 5 | }) 6 | export class BadgesComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/theme/typography.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'typography.component.html' 5 | }) 6 | export class TypographyComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/unauthorized/unauthorized.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-dashboard', 5 | templateUrl: 'unauthorized.component.html' 6 | }) 7 | export class UnauthorizedComponent { } 8 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunobritodev/IdentityServer4AngularOIDC/HEAD/IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/icons/coreui-icons.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'coreui-icons.component.html' 5 | }) 6 | export class CoreUIIconsComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/icons/font-awesome.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'font-awesome.component.html' 5 | }) 6 | export class FontAwesomeComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/buttons/brand-buttons.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'brand-buttons.component.html' 5 | }) 6 | export class BrandButtonsComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /AngularOIDC/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/icons/simple-line-icons.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'simple-line-icons.component.html' 5 | }) 6 | export class SimpleLineIconsComponent { 7 | 8 | constructor() { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /AngularOIDC/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor/globals'; 2 | 3 | export class CoreUIPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/register/register.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-dashboard', 5 | templateUrl: 'register.component.html' 6 | }) 7 | export class RegisterComponent { 8 | 9 | constructor() { } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Shared/Redirect.cshtml: -------------------------------------------------------------------------------- 1 | @model RedirectViewModel 2 | 3 |

You are now being returned to the application.

4 |

Once complete, you may close this tab

5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AngularOIDC/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.md] 13 | max_line_length = off 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /AngularOIDC/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { CoreUIPage } from './app.po'; 2 | 3 | describe('core-ui App', function() { 4 | let page: CoreUIPage; 5 | 6 | beforeEach(() => { 7 | page = new CoreUIPage(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /AngularOIDC/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [], 8 | "paths": { 9 | "@angular/*": [ 10 | "../node_modules/@angular/*" 11 | ] 12 | } 13 | }, 14 | "exclude": [ 15 | "test.ts", 16 | "**/*.spec.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/core/auth/auth.config.ts: -------------------------------------------------------------------------------- 1 | import { AuthConfig } from 'angular-oauth2-oidc'; 2 | 3 | export const authConfig: AuthConfig = { 4 | 5 | issuer: 'http://localhost:5000', 6 | clientId: 'angularoidc', 7 | postLogoutRedirectUri: 'http://localhost:4200/', 8 | redirectUri: window.location.origin + "/login-callback", 9 | scope:"openid profile email apiFinanceiro", 10 | oidc: true, 11 | } -------------------------------------------------------------------------------- /AngularOIDC/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "types": [ 8 | "jasmine", 9 | "node" 10 | ] 11 | }, 12 | "files": [ 13 | "test.ts", 14 | "polyfills.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Quickstart/Account/RedirectViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | 6 | namespace IdentityServer4.Quickstart.UI 7 | { 8 | public class RedirectViewModel 9 | { 10 | public string RedirectUrl { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /AngularOIDC/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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; } = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | } -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/collapses.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'collapses.component.html' 5 | }) 6 | export class CollapsesComponent { 7 | 8 | constructor() { } 9 | 10 | isCollapsed: boolean = false; 11 | 12 | collapsed(event: any): void { 13 | // console.log(event); 14 | } 15 | 16 | expanded(event: any): void { 17 | // console.log(event); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { OAuthService } from 'angular-oauth2-oidc'; 3 | 4 | @Component({ 5 | selector: 'app-dashboard', 6 | templateUrl: 'login.component.html' 7 | }) 8 | export class LoginComponent { 9 | constructor(private oauthService: OAuthService) { 10 | } 11 | 12 | public login() { 13 | this.oauthService.initImplicitFlow("login"); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/chartjs/chartjs.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { ChartsModule } from 'ng2-charts/ng2-charts'; 3 | 4 | import { ChartJSComponent } from './chartjs.component'; 5 | import { ChartJSRoutingModule } from './chartjs-routing.module'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | ChartJSRoutingModule, 10 | ChartsModule 11 | ], 12 | declarations: [ ChartJSComponent ] 13 | }) 14 | export class ChartJSModule { } 15 | -------------------------------------------------------------------------------- /AngularOIDC/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | Server 6 | Server 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /AngularOIDC/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false, 8 | API_URL: "http://localhost:5001/" 9 | }; 10 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/notifications/modals.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild } from '@angular/core'; 2 | import { ModalDirective } from 'ngx-bootstrap/modal'; 3 | 4 | @Component({ 5 | templateUrl: 'modals.component.html' 6 | }) 7 | export class ModalsComponent { 8 | public myModal; 9 | public largeModal; 10 | public smallModal; 11 | public primaryModal; 12 | public successModal; 13 | public warningModal; 14 | public dangerModal; 15 | public infoModal; 16 | } 17 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/chartjs/chartjs-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { ChartJSComponent } from './chartjs.component'; 5 | 6 | const routes: Routes = [ 7 | { 8 | path: '', 9 | component: ChartJSComponent, 10 | data: { 11 | title: 'Charts' 12 | } 13 | } 14 | ]; 15 | 16 | @NgModule({ 17 | imports: [RouterModule.forChild(routes)], 18 | exports: [RouterModule] 19 | }) 20 | export class ChartJSRoutingModule {} 21 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/widgets/widgets-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { WidgetsComponent } from './widgets.component'; 5 | 6 | const routes: Routes = [ 7 | { 8 | path: '', 9 | component: WidgetsComponent, 10 | data: { 11 | title: 'Widgets' 12 | } 13 | } 14 | ]; 15 | 16 | @NgModule({ 17 | imports: [RouterModule.forChild(routes)], 18 | exports: [RouterModule] 19 | }) 20 | export class WidgetsRoutingModule {} 21 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/widgets/widgets.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { ChartsModule } from 'ng2-charts/ng2-charts'; 3 | import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; 4 | 5 | import { WidgetsComponent } from './widgets.component'; 6 | import { WidgetsRoutingModule } from './widgets-routing.module'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | WidgetsRoutingModule, 11 | ChartsModule, 12 | BsDropdownModule 13 | ], 14 | declarations: [ WidgetsComponent ] 15 | }) 16 | export class WidgetsModule { } 17 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/dashboard/dashboard-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, 3 | RouterModule } from '@angular/router'; 4 | 5 | import { DashboardComponent } from './dashboard.component'; 6 | 7 | const routes: Routes = [ 8 | { 9 | path: '', 10 | component: DashboardComponent, 11 | data: { 12 | title: 'Dashboard' 13 | } 14 | } 15 | ]; 16 | 17 | @NgModule({ 18 | imports: [RouterModule.forChild(routes)], 19 | exports: [RouterModule] 20 | }) 21 | export class DashboardRoutingModule {} 22 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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') -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /ProtectedResources/ProtectedResources.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/tooltips.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, SecurityContext} from '@angular/core'; 2 | import {DomSanitizer} from "@angular/platform-browser"; 3 | 4 | @Component({ 5 | templateUrl: 'tooltips.component.html' 6 | }) 7 | export class TooltipsComponent { 8 | 9 | constructor(sanitizer: DomSanitizer) { 10 | this.html = sanitizer.sanitize(SecurityContext.HTML, this.html) 11 | } 12 | 13 | content: string = 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus.'; 14 | html: string = `Never trust not sanitized HTML!!!`; 15 | } 16 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/cotacao/cotacao.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { CotacaoComponent } from './cotacao.component'; 4 | import { Routes, RouterModule } from '@angular/router'; 5 | 6 | const routes: Routes = [ 7 | { 8 | path: '', 9 | component: CotacaoComponent 10 | } 11 | ]; 12 | 13 | @NgModule({ 14 | imports: [ 15 | CommonModule, 16 | RouterModule.forChild(routes) 17 | ], 18 | exports: [RouterModule], 19 | declarations: [CotacaoComponent] 20 | }) 21 | export class CotacaoModule { } 22 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/theme/theme.module.ts: -------------------------------------------------------------------------------- 1 | // Angular 2 | import { CommonModule } from '@angular/common'; 3 | import { NgModule } from '@angular/core'; 4 | 5 | import { ColorsComponent } from './colors.component'; 6 | import { TypographyComponent } from './typography.component'; 7 | 8 | // Theme Routing 9 | import { ThemeRoutingModule } from './theme-routing.module'; 10 | 11 | @NgModule({ 12 | imports: [ 13 | CommonModule, 14 | ThemeRoutingModule 15 | ], 16 | declarations: [ 17 | ColorsComponent, 18 | TypographyComponent 19 | ] 20 | }) 21 | export class ThemeModule { } 22 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/core/auth/auth.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanActivate, Router } from '@angular/router'; 3 | import { OAuthService } from "angular-oauth2-oidc"; 4 | 5 | @Injectable() 6 | export class AuthGuard implements CanActivate { 7 | 8 | constructor( 9 | private router: Router, 10 | private oauthService: OAuthService) { } 11 | 12 | canActivate() { 13 | if (this.oauthService.hasValidIdToken() || this.oauthService.hasValidAccessToken()) { 14 | return true; 15 | } 16 | 17 | this.router.navigate(["/unauthorized"]); 18 | } 19 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/popovers.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, SecurityContext} from '@angular/core'; 2 | import {DomSanitizer} from '@angular/platform-browser'; 3 | 4 | 5 | @Component({ 6 | templateUrl: 'popovers.component.html' 7 | }) 8 | export class PopoversComponent { 9 | 10 | constructor(sanitizer: DomSanitizer) { 11 | this.html = sanitizer.sanitize(SecurityContext.HTML, this.html) 12 | } 13 | 14 | title: string = 'Welcome word'; 15 | content: string = 'Vivamus sagittis lacus vel augue laoreet rutrum faucibus.'; 16 | html: string = `Never trust not sanitized HTML!!!`; 17 | } 18 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/forms.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'forms.component.html' 5 | }) 6 | export class FormsComponent { 7 | 8 | constructor() { } 9 | 10 | isCollapsed: boolean = false; 11 | iconCollapse: string = "icon-arrow-up"; 12 | 13 | collapsed(event: any): void { 14 | // console.log(event); 15 | } 16 | 17 | expanded(event: any): void { 18 | // console.log(event); 19 | } 20 | 21 | toggleCollapse(): void { 22 | this.isCollapsed = !this.isCollapsed; 23 | this.iconCollapse = this.isCollapsed ? "icon-arrow-down" : "icon-arrow-up"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | } -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/icons/icons.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { CoreUIIconsComponent } from './coreui-icons.component'; 4 | import { FlagsComponent } from './flags.component'; 5 | import { FontAwesomeComponent } from './font-awesome.component'; 6 | import { SimpleLineIconsComponent } from './simple-line-icons.component'; 7 | 8 | import { IconsRoutingModule } from './icons-routing.module'; 9 | 10 | @NgModule({ 11 | imports: [ IconsRoutingModule ], 12 | declarations: [ 13 | CoreUIIconsComponent, 14 | FlagsComponent, 15 | FontAwesomeComponent, 16 | SimpleLineIconsComponent 17 | ] 18 | }) 19 | export class IconsModule { } 20 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 |
-------------------------------------------------------------------------------- /AngularOIDC/src/app/views/dashboard/dashboard.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { FormsModule } from '@angular/forms'; 3 | import { ChartsModule } from 'ng2-charts/ng2-charts'; 4 | import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; 5 | import { ButtonsModule } from 'ngx-bootstrap/buttons'; 6 | 7 | import { DashboardComponent } from './dashboard.component'; 8 | import { DashboardRoutingModule } from './dashboard-routing.module'; 9 | 10 | @NgModule({ 11 | imports: [ 12 | FormsModule, 13 | DashboardRoutingModule, 14 | ChartsModule, 15 | BsDropdownModule, 16 | ButtonsModule.forRoot() 17 | ], 18 | declarations: [ DashboardComponent ] 19 | }) 20 | export class DashboardModule { } 21 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace Server 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ProtectedResources/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace ProtectedResources 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /AngularOIDC/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Diagnostics/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model DiagnosticsViewModel 2 | 3 |

Authentication cookie

4 | 5 |

Claims

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

Properties

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

Clients

26 |
    27 | @foreach (var client in Model.Clients) 28 | { 29 |
  • @client
  • 30 | } 31 |
32 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | "Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:5000" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | public string ClientId { get; set; } 12 | 13 | public bool ShowView => ViewModel != null; 14 | public ConsentViewModel ViewModel { get; set; } 15 | 16 | public bool HasValidationError => ValidationError != null; 17 | public string ValidationError { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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; } = false; 14 | 15 | public string LogoutId { get; set; } 16 | public bool TriggerExternalSignout => ExternalAuthenticationScheme != null; 17 | public string ExternalAuthenticationScheme { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | -------------------------------------------------------------------------------- /AngularOIDC/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/paginations.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, ViewEncapsulation } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'paginations.component.html', 5 | styles: ['.pager li.btn:active { box-shadow: none; }'], 6 | encapsulation: ViewEncapsulation.None 7 | }) 8 | export class PaginationsComponent { 9 | 10 | constructor() { } 11 | 12 | totalItems: number = 64; 13 | currentPage: number = 4; 14 | smallnumPages: number = 0; 15 | 16 | setPage(pageNo: number): void { 17 | this.currentPage = pageNo; 18 | } 19 | 20 | pageChanged(event: any): void { 21 | console.log('Page changed to: ' + event.page); 22 | console.log('Number items per page: ' + event.itemsPerPage); 23 | } 24 | 25 | maxSize: number = 5; 26 | bigTotalItems: number = 675; 27 | bigCurrentPage: number = 1; 28 | numPages: number = 0; 29 | 30 | currentPager: number = 4; 31 | } 32 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/buttons/buttons.module.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { FormsModule } from '@angular/forms'; 3 | import { NgModule } from '@angular/core'; 4 | 5 | import { ButtonsComponent } from './buttons.component'; 6 | import { BrandButtonsComponent } from './brand-buttons.component'; 7 | 8 | // Dropdowns Component 9 | import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; 10 | import { DropdownsComponent } from './dropdowns.component'; 11 | 12 | // Buttons Routing 13 | import { ButtonsRoutingModule } from './buttons-routing.module'; 14 | 15 | // Angular 16 | 17 | @NgModule({ 18 | imports: [ 19 | CommonModule, 20 | ButtonsRoutingModule, 21 | BsDropdownModule.forRoot(), 22 | FormsModule 23 | ], 24 | declarations: [ 25 | ButtonsComponent, 26 | DropdownsComponent, 27 | BrandButtonsComponent 28 | ] 29 | }) 30 | export class ButtonsModule { } 31 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/theme/theme-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { ColorsComponent } from './colors.component'; 5 | import { TypographyComponent } from './typography.component'; 6 | 7 | const routes: Routes = [ 8 | { 9 | path: '', 10 | data: { 11 | title: 'Theme' 12 | }, 13 | children: [ 14 | { 15 | path: 'colors', 16 | component: ColorsComponent, 17 | data: { 18 | title: 'Colors' 19 | } 20 | }, 21 | { 22 | path: 'typography', 23 | component: TypographyComponent, 24 | data: { 25 | title: 'Typography' 26 | } 27 | } 28 | ] 29 | } 30 | ]; 31 | 32 | @NgModule({ 33 | imports: [RouterModule.forChild(routes)], 34 | exports: [RouterModule] 35 | }) 36 | export class ThemeRoutingModule {} 37 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Quickstart/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using IdentityServer4.Stores; 3 | 4 | namespace IdentityServer4.Quickstart.UI 5 | { 6 | public static class Extensions 7 | { 8 | /// 9 | /// Determines whether the client is configured to use PKCE. 10 | /// 11 | /// The store. 12 | /// The client identifier. 13 | /// 14 | public static async Task IsPkceClientAsync(this IClientStore store, string client_id) 15 | { 16 | if (!string.IsNullOrWhiteSpace(client_id)) 17 | { 18 | var client = await store.FindEnabledClientByIdAsync(client_id); 19 | return client?.RequirePkce == true; 20 | } 21 | 22 | return false; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /AngularOIDC/src/index.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | CoreUI - Free Angular Admin Template 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ProtectedResources/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5001", 7 | "sslPort": 0 8 | } 9 | }, 10 | "$schema": "http://json.schemastore.org/launchsettings.json", 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "api/values", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "ProtectedResources": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "api/values", 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | }, 27 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /AngularOIDC/src/app/containers/default-layout/default-layout.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { navItems } from '../../_nav'; 3 | import { OAuthService } from 'angular-oauth2-oidc'; 4 | 5 | @Component({ 6 | selector: 'app-dashboard', 7 | templateUrl: './default-layout.component.html' 8 | }) 9 | export class DefaultLayoutComponent { 10 | public navItems = navItems; 11 | public sidebarMinimized = true; 12 | private changes: MutationObserver; 13 | public element: HTMLElement = document.body; 14 | constructor(private oauthService: OAuthService) { 15 | 16 | this.changes = new MutationObserver((mutations) => { 17 | this.sidebarMinimized = document.body.classList.contains('sidebar-minimized') 18 | }); 19 | 20 | this.changes.observe(this.element, { 21 | attributes: true 22 | }); 23 | } 24 | 25 | public logout(){ 26 | this.oauthService.logOut(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/notifications/notifications.module.ts: -------------------------------------------------------------------------------- 1 | // Angular 2 | import { CommonModule } from '@angular/common'; 3 | import { NgModule } from '@angular/core'; 4 | 5 | // Alert Component 6 | import { AlertModule } from 'ngx-bootstrap/alert'; 7 | import { AlertsComponent } from './alerts.component'; 8 | 9 | import { BadgesComponent } from './badges.component'; 10 | 11 | // Modal Component 12 | import { ModalModule } from 'ngx-bootstrap/modal'; 13 | import { ModalsComponent } from './modals.component'; 14 | 15 | // Notifications Routing 16 | import { NotificationsRoutingModule } from './notifications-routing.module'; 17 | 18 | @NgModule({ 19 | imports: [ 20 | CommonModule, 21 | NotificationsRoutingModule, 22 | AlertModule.forRoot(), 23 | ModalModule.forRoot() 24 | ], 25 | declarations: [ 26 | AlertsComponent, 27 | BadgesComponent, 28 | ModalsComponent 29 | ] 30 | }) 31 | export class NotificationsModule { } 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ASP.NET Core & IdentityServer4 - Acessando recursos protegidos 2 | 3 | 4 | Example App - IdentityServer4 login through Angular and OpenId Connect 5 | 6 | * **Server Side**: ASP.NET Core with IdentityServer4 7 | * **Front-end**: Angular 6 with CoreUI template. 8 | 9 | Pre reqs 10 | 11 | * Net.Core 2.1 12 | * angular-cli 6+ 13 | 14 | Techs: 15 | 16 | * ASP.NET Core 17 | * IdentityServer 18 | * angular-oauth2-oidc 19 | * Angular 6 20 | * CoreUI 21 | 22 | # How to run 23 | 24 | 1. Open IdentityServer4AngularOIDC.sln with Visual Studio and Run 25 | 2. Load Folder AngularOIDC with VSCode 26 | * Open terminas (CTRL + \`) 27 | * npm install 28 | * npm start 29 | 30 | 31 | More about on [ASP.NET Core - Autenticação utilizando Angular OIDC, CoreUI e IdentityServer4](https://www.brunobrito.net.br/implicity-angular-oidc-identityserver4/) - Portuguese only 32 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/carousels.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { CarouselConfig } from 'ngx-bootstrap/carousel'; 3 | 4 | @Component({ 5 | templateUrl: 'carousels.component.html', providers: [ 6 | { provide: CarouselConfig, useValue: { interval: 1500, noPause: true } } 7 | ] 8 | }) 9 | export class CarouselsComponent { 10 | 11 | myInterval: number = 6000; 12 | slides: any[] = []; 13 | activeSlideIndex: number = 0; 14 | noWrapSlides: boolean = false; 15 | 16 | constructor() { 17 | for (let i = 0; i < 4; i++) { 18 | this.addSlide(); 19 | } 20 | } 21 | 22 | addSlide(): void { 23 | this.slides.push({ 24 | image: `https://lorempixel.com/900/500/sports/${this.slides.length % 8 + 1}/` 25 | }); 26 | } 27 | 28 | removeSlide(index?: number): void { 29 | const toRemove = index ? index : this.activeSlideIndex; 30 | this.slides.splice(toRemove, 1); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/login/login-callback.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { OAuthService, AuthConfig } from "angular-oauth2-oidc"; 3 | import { Router } from "@angular/router"; 4 | import { authConfig } from '../../core/auth/auth.config'; 5 | 6 | @Component({ 7 | template: '' 8 | }) 9 | export class LoginCallbackComponent implements OnInit { 10 | 11 | constructor(private oauthService: OAuthService, private router: Router) { 12 | } 13 | 14 | ngOnInit() { 15 | this.oauthService.loadDiscoveryDocument().then(() => { 16 | 17 | // This method just tries to parse the token(s) within the url when 18 | // the auth-server redirects the user back to the web-app 19 | // It dosn't send the user the the login page 20 | this.oauthService.tryLogin({onTokenReceived: () => this.router.navigate(["/dashboard"])}); 21 | 22 | }); 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Quickstart/Grants/GrantsViewModel.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 | 8 | namespace IdentityServer4.Quickstart.UI 9 | { 10 | public class GrantsViewModel 11 | { 12 | public IEnumerable Grants { get; set; } 13 | } 14 | 15 | public class GrantViewModel 16 | { 17 | public string ClientId { get; set; } 18 | public string ClientName { get; set; } 19 | public string ClientUrl { get; set; } 20 | public string ClientLogoUrl { get; set; } 21 | public DateTime Created { get; set; } 22 | public DateTime? Expires { get; set; } 23 | public IEnumerable IdentityGrantNames { get; set; } 24 | public IEnumerable ApiGrantNames { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/error/404.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |

404

7 |

Oops! You're lost.

8 |

The page you are looking for was not found.

9 |
10 |
11 |
12 | 13 |
14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |
22 |
23 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/error/500.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |

500

7 |

Houston, we have a problem!

8 |

The page you are looking for is temporarily unavailable.

9 |
10 |
11 |
12 | 13 |
14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |
22 |
23 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/cotacao/cotacao.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Observable, Subscription } from '../../../../node_modules/rxjs'; 3 | import { CotacaoService } from './cotacao.service'; 4 | import { IntervalObservable } from "rxjs/observable/IntervalObservable"; 5 | import { Moedas } from '../../shared/models/moedas.model'; 6 | 7 | @Component({ 8 | templateUrl: './cotacao.component.html', 9 | styleUrls: ['./cotacao.component.scss'] 10 | }) 11 | export class CotacaoComponent implements OnInit { 12 | 13 | public cotacoes: Observable; 14 | sub: Subscription; 15 | constructor(private cotacaoService: CotacaoService) { } 16 | 17 | ngOnInit() { 18 | this.obterCotacoes(); 19 | this.sub = IntervalObservable.create(35000).subscribe(() => this.obterCotacoes()); 20 | } 21 | 22 | public ngOnDestroy(): void { 23 | this.sub.unsubscribe(); 24 | } 25 | 26 | public obterCotacoes() { 27 | this.cotacoes = this.cotacaoService.obterCotacoes(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/cotacao/cotacao.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient, HttpHeaders } from '../../../../node_modules/@angular/common/http'; 3 | import { Observable } from '../../../../node_modules/rxjs'; 4 | import { environment } from '../../../environments/environment'; 5 | import { OAuthService } from '../../../../node_modules/angular-oauth2-oidc'; 6 | import { Moedas } from '../../shared/models/moedas.model'; 7 | 8 | @Injectable({ 9 | providedIn: 'root' 10 | }) 11 | export class CotacaoService { 12 | 13 | private defaultHeader: HttpHeaders; 14 | constructor(private http: HttpClient, private oauth: OAuthService) { 15 | this.defaultHeader = new HttpHeaders().set('Accept', 'application/json').set('Authorization', 'Bearer ' + this.oauth.getAccessToken()); 16 | } 17 | 18 | public obterCotacoes(): Observable { 19 | const url = "cotacao/criptoMoedas"; 20 | 21 | return this.http.get(environment.API_URL + url,{ headers: this.defaultHeader }); 22 | } 23 | } -------------------------------------------------------------------------------- /ProtectedResources/Model/MoedaViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ProtectedResources.Model 4 | { 5 | public class MoedaViewModel 6 | { 7 | public int Id { get; set; } 8 | public string Nome { get; set; } 9 | public string Simbolo { get; set; } 10 | public int Rank { get; set; } 11 | public decimal Preco { get; set; } 12 | } 13 | 14 | public class ListaMoedas 15 | { 16 | public IEnumerable data { get; set; } 17 | } 18 | 19 | 20 | public class Cotacao 21 | { 22 | public decimal price { get; set; } 23 | } 24 | public class ListaCotacao 25 | { 26 | public Dictionary quotes { get; set; } 27 | } 28 | 29 | public class Moeda 30 | { 31 | public int id { get; set; } 32 | public string name { get; set; } 33 | public string symbol { get; set; } 34 | public int cmc_rank { get; set; } 35 | public Dictionary quote { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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; } = true; 14 | public bool EnableLocalLogin { get; set; } = true; 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 => IsExternalLoginOnly ? ExternalProviders?.SingleOrDefault()?.AuthenticationScheme : null; 21 | } 22 | } -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/buttons/dropdowns.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'dropdowns.component.html', 5 | }) 6 | export class DropdownsComponent { 7 | 8 | constructor() { } 9 | 10 | items: string[] = [ 11 | 'The first choice!', 12 | 'And another choice for you.', 13 | 'but wait! A third!' 14 | ]; 15 | 16 | onHidden(): void { 17 | console.log('Dropdown is hidden'); 18 | } 19 | onShown(): void { 20 | console.log('Dropdown is shown'); 21 | } 22 | isOpenChange(): void { 23 | console.log('Dropdown state is changed'); 24 | } 25 | 26 | status: { isOpen: boolean } = { isOpen: false }; 27 | 28 | toggleDropdown($event: MouseEvent): void { 29 | $event.preventDefault(); 30 | $event.stopPropagation(); 31 | this.status.isOpen = !this.status.isOpen; 32 | } 33 | 34 | change(value: boolean): void { 35 | this.status.isOpen = value; 36 | } 37 | 38 | disabled: boolean = false; 39 | 40 | isDropup: boolean = true; 41 | 42 | autoClose: boolean = false; 43 | } 44 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/collapses.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Bootstrap Collapse 5 | 10 |
11 |
15 |

16 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo 17 | consequat. 18 |

19 |
20 | 25 |
26 |
27 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 |
  • -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Quickstart/Diagnostics/DiagnosticsController.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.Linq; 6 | using System.Threading.Tasks; 7 | using Microsoft.AspNetCore.Authentication; 8 | using Microsoft.AspNetCore.Authorization; 9 | using Microsoft.AspNetCore.Mvc; 10 | 11 | namespace IdentityServer4.Quickstart.UI 12 | { 13 | [SecurityHeaders] 14 | [Authorize] 15 | public class DiagnosticsController : Controller 16 | { 17 | public async Task Index() 18 | { 19 | var localAddresses = new string[] { "127.0.0.1", "::1", HttpContext.Connection.LocalIpAddress.ToString() }; 20 | if (!localAddresses.Contains(HttpContext.Connection.RemoteIpAddress.ToString())) 21 | { 22 | return NotFound(); 23 | } 24 | 25 | var model = new DiagnosticsViewModel(await HttpContext.AuthenticateAsync()); 26 | return View(model); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Bruno Brito 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 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "https://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jquery-validation/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.17.0", 31 | "_release": "1.17.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.17.0", 35 | "commit": "fc9b12d3bfaa2d0c04605855b896edb2934c0772" 36 | }, 37 | "_source": "https://github.com/jzaefferer/jquery-validation.git", 38 | "_target": "^1.17.0", 39 | "_originalSource": "jquery-validation", 40 | "_direct": true 41 | } -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/cotacao/cotacao.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 4 |
    5 |
    6 |
    7 | Cotação atual de moedas virtuais 8 |
    9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
    NomeSimboloRankPreco
    {{cotacao.nome}}{{cotacao.simbolo}}{{cotacao.rank}}USD {{ cotacao.preco | currency }}
    28 |
    29 |
    30 |
    31 | 32 |
    33 |
    -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/notifications/notifications-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { AlertsComponent } from './alerts.component'; 5 | import { BadgesComponent } from './badges.component'; 6 | import { ModalsComponent } from './modals.component'; 7 | 8 | const routes: Routes = [ 9 | { 10 | path: '', 11 | data: { 12 | title: 'Notifications' 13 | }, 14 | children: [ 15 | { 16 | path: 'alerts', 17 | component: AlertsComponent, 18 | data: { 19 | title: 'Alerts' 20 | } 21 | }, 22 | { 23 | path: 'badges', 24 | component: BadgesComponent, 25 | data: { 26 | title: 'Badges' 27 | } 28 | }, 29 | { 30 | path: 'modals', 31 | component: ModalsComponent, 32 | data: { 33 | title: 'Modals' 34 | } 35 | } 36 | ] 37 | } 38 | ]; 39 | 40 | @NgModule({ 41 | imports: [RouterModule.forChild(routes)], 42 | exports: [RouterModule] 43 | }) 44 | export class NotificationsRoutingModule {} 45 | -------------------------------------------------------------------------------- /AngularOIDC/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/unauthorized/unauthorized.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 |
    6 |
    7 |
    8 |
    9 |

    Unauthorized

    10 |

    You do not have access to this area.

    11 |
    12 |
    13 |
    14 |
    15 |
    16 |

    Contact administrator

    17 |
    18 |
    19 |
    20 |
    21 |
    22 |
    23 |
    24 |
    25 |
    -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/buttons/buttons-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { ButtonsComponent } from './buttons.component'; 5 | import { DropdownsComponent } from './dropdowns.component'; 6 | import { BrandButtonsComponent } from './brand-buttons.component'; 7 | 8 | const routes: Routes = [ 9 | { 10 | path: '', 11 | data: { 12 | title: 'Buttons' 13 | }, 14 | children: [ 15 | { 16 | path: 'buttons', 17 | component: ButtonsComponent, 18 | data: { 19 | title: 'Buttons' 20 | } 21 | }, 22 | { 23 | path: 'dropdowns', 24 | component: DropdownsComponent, 25 | data: { 26 | title: 'Dropdowns' 27 | } 28 | }, 29 | { 30 | path: 'brand-buttons', 31 | component: BrandButtonsComponent, 32 | data: { 33 | title: 'Brand buttons' 34 | } 35 | } 36 | ] 37 | } 38 | ]; 39 | 40 | @NgModule({ 41 | imports: [RouterModule.forChild(routes)], 42 | exports: [RouterModule] 43 | }) 44 | export class ButtonsRoutingModule {} 45 | -------------------------------------------------------------------------------- /AngularOIDC/src/scss/vendors/chart.js/chart.scss: -------------------------------------------------------------------------------- 1 | // Import variables 2 | @import '../variables'; 3 | 4 | .chart-legend, 5 | .bar-legend, 6 | .line-legend, 7 | .pie-legend, 8 | .radar-legend, 9 | .polararea-legend, 10 | .doughnut-legend { 11 | list-style-type: none; 12 | margin-top: 5px; 13 | text-align: center; 14 | -webkit-padding-start: 0; 15 | -moz-padding-start: 0; 16 | padding-left: 0; 17 | } 18 | .chart-legend li, 19 | .bar-legend li, 20 | .line-legend li, 21 | .pie-legend li, 22 | .radar-legend li, 23 | .polararea-legend li, 24 | .doughnut-legend li { 25 | display: inline-block; 26 | white-space: nowrap; 27 | position: relative; 28 | margin-bottom: 4px; 29 | @include border-radius($border-radius); 30 | padding: 2px 8px 2px 28px; 31 | font-size: smaller; 32 | cursor: default; 33 | } 34 | .chart-legend li span, 35 | .bar-legend li span, 36 | .line-legend li span, 37 | .pie-legend li span, 38 | .radar-legend li span, 39 | .polararea-legend li span, 40 | .doughnut-legend li span { 41 | display: block; 42 | position: absolute; 43 | left: 0; 44 | top: 0; 45 | width: 20px; 46 | height: 20px; 47 | @include border-radius($border-radius); 48 | } 49 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | // specify the Windows authentication scheme being used 19 | public static readonly string WindowsAuthenticationSchemeName = Microsoft.AspNetCore.Server.IISIntegration.IISDefaults.AuthenticationScheme; 20 | // if user uses windows auth, should we load the groups from windows 21 | public static bool IncludeWindowsGroups = false; 22 | 23 | public static string InvalidCredentialsErrorMessage = "Invalid username or password"; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | 3 | @{ 4 | var error = Model?.Error?.Error; 5 | var errorDescription = Model?.Error?.ErrorDescription; 6 | var request_id = Model?.Error?.RequestId; 7 | } 8 | 9 |
    10 | 13 | 14 |
    15 |
    16 |
    17 | Sorry, there was an error 18 | 19 | @if (error != null) 20 | { 21 | 22 | 23 | : @error 24 | 25 | 26 | 27 | if (errorDescription != null) 28 | { 29 |
    @errorDescription
    30 | } 31 | } 32 |
    33 | 34 | @if (request_id != null) 35 | { 36 |
    Request Id: @request_id
    37 | } 38 |
    39 |
    40 |
    41 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/theme/colors.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { getStyle, rgbToHex } from '@coreui/coreui/dist/js/coreui-utilities' 3 | 4 | @Component({ 5 | templateUrl: 'colors.component.html' 6 | }) 7 | export class ColorsComponent implements OnInit { 8 | public themeColors(): void { 9 | Array.from(document.querySelectorAll('.theme-color')).forEach(function(el) { 10 | let elem = document.getElementsByClassName(el.classList[0])[0]; 11 | let background = getStyle('background-color', elem); 12 | 13 | let table = document.createElement('table'); 14 | table.innerHTML = ` 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
    HEX:${rgbToHex(background)}
    RGB:${background}
    25 | `; 26 | 27 | el.parentNode.appendChild(table); 28 | }); 29 | 30 | } 31 | 32 | ngOnInit(): void { 33 | this.themeColors(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 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 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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:'';} -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Quickstart/Diagnostics/DiagnosticsViewModel.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 Microsoft.AspNetCore.Authentication; 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | 11 | namespace IdentityServer4.Quickstart.UI 12 | { 13 | public class DiagnosticsViewModel 14 | { 15 | public DiagnosticsViewModel(AuthenticateResult result) 16 | { 17 | AuthenticateResult = result; 18 | 19 | if (result.Properties.Items.ContainsKey("client_list")) 20 | { 21 | var encoded = result.Properties.Items["client_list"]; 22 | var bytes = Base64Url.Decode(encoded); 23 | var value = Encoding.UTF8.GetString(bytes); 24 | 25 | Clients = JsonConvert.DeserializeObject(value); 26 | } 27 | } 28 | 29 | public AuthenticateResult AuthenticateResult { get; } 30 | public IEnumerable Clients { get; } = new List(); 31 | } 32 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
    3 |

    4 | Welcome to {{ title }}! 5 |

    6 | Angular Logo 7 |
    8 |

    Here are some links to help you start:

    9 | 20 | 21 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Router, NavigationEnd } from '@angular/router'; 3 | import { OAuthService, JwksValidationHandler } from 'angular-oauth2-oidc'; 4 | import { authConfig } from './core/auth/auth.config'; 5 | 6 | @Component({ 7 | // tslint:disable-next-line 8 | selector: 'body', 9 | template: '' 10 | }) 11 | export class AppComponent implements OnInit { 12 | constructor(private router: Router, 13 | private oauthService: OAuthService) { 14 | this.configureWithNewConfigApi(); 15 | } 16 | 17 | private async configureWithNewConfigApi() { 18 | this.oauthService.configure(authConfig); 19 | this.oauthService.setStorage(localStorage); 20 | this.oauthService.tokenValidationHandler = new JwksValidationHandler(); 21 | 22 | 23 | await this.oauthService.loadDiscoveryDocumentAndTryLogin(); 24 | if (this.oauthService.hasValidIdToken() || this.oauthService.hasValidAccessToken()) { 25 | this.router.navigate(["/dashboard"]); 26 | } 27 | } 28 | 29 | ngOnInit() { 30 | this.router.events.subscribe((evt) => { 31 | if (!(evt instanceof NavigationEnd)) { 32 | return; 33 | } 34 | window.scrollTo(0, 0) 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | -------------------------------------------------------------------------------- /ProtectedResources/Controllers/CotacaoController.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Net.Http; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Authorization; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Newtonsoft.Json; 7 | using ProtectedResources.Model; 8 | 9 | namespace ProtectedResources.Controllers 10 | { 11 | [Route("[controller]")] 12 | [Authorize] 13 | public class CotacaoController : ControllerBase 14 | { 15 | [Route("criptoMoedas")] 16 | public async Task CriptoMoedas() 17 | { 18 | HttpClient client = new HttpClient(); 19 | 20 | // Free key with several limits - Get another at https://coinmarketcap.com/pt-br/ 21 | client.DefaultRequestHeaders.Add("X-CMC_PRO_API_KEY", "9758b4ec-a00e-4cc3-94e3-f74cdf061516"); 22 | 23 | var conteudo = await client.GetStringAsync("https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?start=1&limit=20"); 24 | 25 | var moedas = JsonConvert.DeserializeObject(conteudo).data.Select(s => new MoedaViewModel() 26 | { 27 | Id = s.id, 28 | Nome = s.name, 29 | Simbolo = s.symbol, 30 | Rank = s.cmc_rank, 31 | Preco = s.quote["USD"].price, 32 | }).ToList(); 33 | return Ok(moedas); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/icons/icons-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { CoreUIIconsComponent } from './coreui-icons.component'; 5 | import { FlagsComponent } from './flags.component'; 6 | import { FontAwesomeComponent } from './font-awesome.component'; 7 | import { SimpleLineIconsComponent } from './simple-line-icons.component'; 8 | 9 | const routes: Routes = [ 10 | { 11 | path: '', 12 | data: { 13 | title: 'Icons' 14 | }, 15 | children: [ 16 | { 17 | path: 'coreui-icons', 18 | component: CoreUIIconsComponent, 19 | data: { 20 | title: 'CoreUI Icons' 21 | } 22 | }, 23 | { 24 | path: 'flags', 25 | component: FlagsComponent, 26 | data: { 27 | title: 'Flags' 28 | } 29 | }, 30 | { 31 | path: 'font-awesome', 32 | component: FontAwesomeComponent, 33 | data: { 34 | title: 'Font Awesome' 35 | } 36 | }, 37 | { 38 | path: 'simple-line-icons', 39 | component: SimpleLineIconsComponent, 40 | data: { 41 | title: 'Simple Line Icons' 42 | } 43 | } 44 | ] 45 | } 46 | ]; 47 | 48 | @NgModule({ 49 | imports: [RouterModule.forChild(routes)], 50 | exports: [RouterModule] 51 | }) 52 | export class IconsRoutingModule {} 53 | -------------------------------------------------------------------------------- /AngularOIDC/src/assets/img/brand/sygnet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/login/login.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 |
    6 |
    7 |
    8 |
    9 |

    Login

    10 |

    Sign In to your account

    11 |
    12 |
    13 | 14 |
    15 |
    16 | 17 |
    18 |
    19 |
    20 |
    21 |
    22 |
    23 |
    24 |

    Sign up

    25 |

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    26 | 27 |
    28 |
    29 |
    30 |
    31 |
    32 |
    33 |
    34 |
    35 |
    36 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/tempkey.rsa: -------------------------------------------------------------------------------- 1 | {"KeyId":"ae62ca254cf9b6261227f7521d9355d6","Parameters":{"D":"CQArFurj1vs6Xh0ZDjhqNK7h2hxllnzJqcUth0j1wgVJh6+pKRMyGPZcjK60taXBcbHrV8zfAnBzHXRjnYmWor4DK78THbyIwQuGvSdpQnLxFugSPPbpcgPULjICAuejfr8iI+qW1HkGFt1838uhHntpQveRErDb88SmQx2M14Vb8STyJjHU3xf4QI3yjV4HZnra88d5WUsUN3v/f9Uiwo+U0CMTcEPMB6TXPupx7FRCvPnHiHAHNEO8RdqynlJasdIrjtx2RIi5EwO/4idqNzClHaT31VN1k1+vX4zNkLzLBAJ8hbZJvM3nv//Q2w31aA1RJXnxrIUAkZFhs7EZcQ==","DP":"diUc4mrxxh2992SAEREBQHZ0pT7j7rk2NCayVCrc98GcJ2V5OdHgUN3N3XxsKaD/iCFQ+mn+cYJHR9/gaBp6UDD15ZUW4wXJg/up/sUqDBphcc114xBDgIoYyojI4Uk8CeTiOeZc34sGGyqI0wA5dylvI6ydRHesiODCD0MouHU=","DQ":"dQhlEYoFc72yavdW4jt5r51UxKQiQB03YFXqDo9pnR7JEtlPjeR9VcLqVo5N3YxpL0+4nEjiE/fjA5dL0NiJ9bqT5gMDgZVlQdkgvKKPOTUU5uVgXo1whfB6vs6AceEAP+SUjM7w81hfoF0m1VUOkig0LL5pPirYJ8gosfBYZE8=","Exponent":"AQAB","InverseQ":"5feezkGGoMJ7ntn9V334E4GmwHiyqdyvWA3TnFUVT8uqswcWLSS6YzxlCp7uJHn/N33g7iaUhI6X+V9Q9ZLRI1eKwkMm2NPTRRQCBGacxXrS8eJKU4uHYLAwk+aWqnxrMdCr+Fa9AyYaEva1Ax57k/6vQz+rPsgewTS0XmolNXk=","Modulus":"7jzN3Q0bE1dnHiKnbOvHdFNjxetKU8lsnrDvgUqM7AzGM2fkx8qQWjSuA6UokQElk/4KGn2aML7RDMT4V2NGV1SQ7nLa3M90ykPNnWEGZVh00WL2LnBToxQUD4dCQ/8B5qFiVNt55/9wEOmj6BCjKj0ukNXR6d3yasNqQ2R+P+zIJ9GcY4bxDVfibeKWDiEuyyvNDOaU8A+MWpzyIYqqe1kuDYVszSeblniVfrWh88HibAI/5PTHPVFUNyWWwXAdlGa9TmlY//del/ZAWamIWzKMIBT2jI7o7LjSH+pL24xz2i2DPVpFeFPmDKFZQOeIzrS8pup7Q3Dt7kX1FEZaYQ==","P":"9GSsNBmyZ8eJGXkN/dfX7v8nBoJL1quiDaWV2RhMba/HL/50H9RBHfZ0etbJotwVmYQvvHkEePOkvgqzWaJBeNOwODLHxzeUpK+d9QlMh9l0DPv5N38n+L2bW15bY4STeXyVP9rzMzZL+PWLRKzCsqmj5MBRlmHHmp5uDcdXP3s=","Q":"+Y1KScXnPlIgvVJ7xPLQaEYzxkTfsV4GXB2jiE3Ugk5uE5f4h8R0unpKhp95w6pDv3julWO2cWk3E7wPwpl/mSeaQSz/vywpEtoyxfKOLbrvRC1nsMD2+Wc69PlfO07e8tadlaoSwohf9ZQHhFwFW4UlZeFQm2zCBvMAgkdEmNM="}} -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | namespace Server 6 | { 7 | public class Startup 8 | { 9 | public void ConfigureServices(IServiceCollection services) 10 | { 11 | services.AddCors(options => 12 | { 13 | options.AddPolicy("Devlopment", 14 | builder => builder.AllowAnyOrigin() 15 | .AllowAnyMethod() 16 | .AllowAnyHeader() 17 | .AllowCredentials()); 18 | }); 19 | services.AddMvc(); 20 | 21 | // Configura o Identity Server com dados em memória. Somente em casos de testes, não use essa abordagem para produção 22 | //services.AddIdentityServer(config => config.IssuerUri = "http://localhost:5000/") 23 | services.AddIdentityServer() 24 | .AddDeveloperSigningCredential() 25 | .AddInMemoryIdentityResources(Config.GetIdentityResources()) 26 | .AddInMemoryClients(Config.GetClients()) 27 | .AddTestUsers(Config.GetUsers()) 28 | .AddInMemoryApiResources(Config.GetApiResources()); 29 | } 30 | 31 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 32 | { 33 | if (env.IsDevelopment()) 34 | { 35 | app.UseCors("Devlopment"); 36 | app.UseDeveloperExceptionPage(); 37 | } 38 | 39 | app.UseIdentityServer(); 40 | app.UseStaticFiles(); 41 | app.UseMvcWithDefaultRoute(); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2035 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "IdentityServer4AngularOIDC\Server.csproj", "{4E99F504-2DED-43E0-A379-AA6757D0F3B7}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtectedResources", "ProtectedResources\ProtectedResources.csproj", "{231E7BEB-5FBD-40B4-A9E4-534FD83AB642}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {4E99F504-2DED-43E0-A379-AA6757D0F3B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {4E99F504-2DED-43E0-A379-AA6757D0F3B7}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {4E99F504-2DED-43E0-A379-AA6757D0F3B7}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {4E99F504-2DED-43E0-A379-AA6757D0F3B7}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {231E7BEB-5FBD-40B4-A9E4-534FD83AB642}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {231E7BEB-5FBD-40B4-A9E4-534FD83AB642}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {231E7BEB-5FBD-40B4-A9E4-534FD83AB642}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {231E7BEB-5FBD-40B4-A9E4-534FD83AB642}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {031E30F5-31EB-41A2-8028-8CD90CCB5C3C} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 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 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | } -------------------------------------------------------------------------------- /ProtectedResources/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace ProtectedResources 7 | { 8 | public class Startup 9 | { 10 | public Startup(IConfiguration configuration) 11 | { 12 | Configuration = configuration; 13 | } 14 | 15 | public IConfiguration Configuration { get; } 16 | 17 | // This method gets called by the runtime. Use this method to add services to the container. 18 | public void ConfigureServices(IServiceCollection services) 19 | { 20 | services.AddCors(options => 21 | { 22 | options.AddPolicy("Devlopment", 23 | builder => builder.AllowAnyOrigin() 24 | .AllowAnyMethod() 25 | .AllowAnyHeader() 26 | .AllowCredentials()); 27 | }); 28 | 29 | services.AddMvcCore() 30 | .AddAuthorization() 31 | .AddJsonFormatters(); 32 | 33 | services.AddAuthentication("Bearer") 34 | .AddIdentityServerAuthentication(options => 35 | { 36 | options.Authority = "http://localhost:5000"; 37 | options.RequireHttpsMetadata = false; 38 | 39 | options.ApiName = "apiFinanceiro"; 40 | }); ; 41 | } 42 | 43 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 44 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 45 | { 46 | if (env.IsDevelopment()) 47 | { 48 | app.UseCors("Devlopment"); 49 | } 50 | app.UseAuthentication(); 51 | app.UseMvc(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/progress.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnDestroy} from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'progress.component.html' 5 | }) 6 | export class ProgressComponent implements OnDestroy { 7 | 8 | max: number = 200; 9 | showWarning: boolean; 10 | dynamic: number; 11 | type: string; 12 | 13 | constructor() { 14 | this.random(); 15 | this.randomStacked() 16 | } 17 | 18 | ngOnDestroy() { 19 | if (this.timer) { 20 | clearInterval(this.timer) 21 | } 22 | // console.log(`onDestroy`, this.timer); 23 | } 24 | 25 | random(): void { 26 | let value = Math.floor(Math.random() * 100 + 1); 27 | let type: string; 28 | 29 | if (value < 25) { 30 | type = 'success'; 31 | } else if (value < 50) { 32 | type = 'info'; 33 | } else if (value < 75) { 34 | type = 'warning'; 35 | } else { 36 | type = 'danger'; 37 | } 38 | 39 | this.showWarning = type === 'danger' || type === 'warning'; 40 | this.dynamic = value; 41 | this.type = type; 42 | 43 | } 44 | 45 | stacked: any[] = []; 46 | 47 | randomStacked(): void { 48 | let types = ['success', 'info', 'warning', 'danger']; 49 | 50 | this.stacked = []; 51 | let n = Math.floor(Math.random() * 4 + 1); 52 | for (let i = 0; i < n; i++) { 53 | let index = Math.floor(Math.random() * 4); 54 | let value = Math.floor(Math.random() * 27 + 3); 55 | this.stacked.push({ 56 | value, 57 | type: types[index], 58 | label: value + ' %' 59 | }); 60 | } 61 | } 62 | 63 | timer: any = null; 64 | buttonCaption: string = 'Start'; 65 | 66 | randomize(): void { 67 | if (this.timer) { 68 | clearInterval(this.timer); 69 | this.timer = null; 70 | } else { 71 | this.timer = setInterval(() => this.randomStacked(), 2000); 72 | } 73 | this.buttonCaption = this.timer ? 'Stop' : 'Start'; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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.Authorization; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.AspNetCore.Mvc; 9 | using System.Threading.Tasks; 10 | 11 | namespace IdentityServer4.Quickstart.UI 12 | { 13 | [SecurityHeaders] 14 | [AllowAnonymous] 15 | public class HomeController : Controller 16 | { 17 | private readonly IIdentityServerInteractionService _interaction; 18 | private readonly IHostingEnvironment _environment; 19 | 20 | public HomeController(IIdentityServerInteractionService interaction, IHostingEnvironment environment) 21 | { 22 | _interaction = interaction; 23 | _environment = environment; 24 | } 25 | 26 | public IActionResult Index() 27 | { 28 | if (_environment.IsDevelopment()) 29 | { 30 | // only show in development 31 | return View(); 32 | } 33 | 34 | return NotFound(); 35 | } 36 | 37 | /// 38 | /// Shows the error page 39 | /// 40 | public async Task Error(string errorId) 41 | { 42 | var vm = new ErrorViewModel(); 43 | 44 | // retrieve error details from identityserver 45 | var message = await _interaction.GetErrorContextAsync(errorId); 46 | if (message != null) 47 | { 48 | vm.Error = message; 49 | 50 | if (!_environment.IsDevelopment()) 51 | { 52 | // only show in development 53 | message.ErrorDescription = null; 54 | } 55 | } 56 | 57 | return View("Error", vm); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 33 | 41 | } -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | } -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/register/register.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 |
    6 |
    7 |
    8 |

    Register

    9 |

    Create your account

    10 |
    11 |
    12 | 13 |
    14 | 15 |
    16 |
    17 |
    18 | @ 19 |
    20 | 21 |
    22 |
    23 |
    24 | 25 |
    26 | 27 |
    28 |
    29 |
    30 | 31 |
    32 | 33 |
    34 | 35 |
    36 | 46 |
    47 |
    48 |
    49 |
    50 |
    51 |
    52 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/base.module.ts: -------------------------------------------------------------------------------- 1 | // Angular 2 | import { CommonModule } from '@angular/common'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { NgModule } from '@angular/core'; 5 | 6 | import { CardsComponent } from './cards.component'; 7 | 8 | // Forms Component 9 | import { FormsComponent } from './forms.component'; 10 | 11 | import { SwitchesComponent } from './switches.component'; 12 | import { TablesComponent } from './tables.component'; 13 | 14 | // Tabs Component 15 | import { TabsModule } from 'ngx-bootstrap/tabs'; 16 | import { TabsComponent } from './tabs.component'; 17 | 18 | // Carousel Component 19 | import { CarouselModule } from 'ngx-bootstrap/carousel'; 20 | import { CarouselsComponent } from './carousels.component'; 21 | 22 | // Collapse Component 23 | import { CollapseModule } from 'ngx-bootstrap/collapse'; 24 | import { CollapsesComponent } from './collapses.component'; 25 | 26 | // Dropdowns Component 27 | import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; 28 | 29 | // Pagination Component 30 | import { PaginationModule } from 'ngx-bootstrap/pagination'; 31 | import { PopoversComponent } from './popovers.component'; 32 | 33 | // Popover Component 34 | import { PopoverModule } from 'ngx-bootstrap/popover'; 35 | import { PaginationsComponent } from './paginations.component'; 36 | 37 | // Progress Component 38 | import { ProgressbarModule } from 'ngx-bootstrap/progressbar'; 39 | import { ProgressComponent } from './progress.component'; 40 | 41 | // Tooltip Component 42 | import { TooltipModule } from 'ngx-bootstrap/tooltip'; 43 | import { TooltipsComponent } from './tooltips.component'; 44 | 45 | 46 | // Components Routing 47 | import { BaseRoutingModule } from './base-routing.module'; 48 | 49 | @NgModule({ 50 | imports: [ 51 | CommonModule, 52 | FormsModule, 53 | BaseRoutingModule, 54 | BsDropdownModule.forRoot(), 55 | TabsModule, 56 | CarouselModule.forRoot(), 57 | CollapseModule.forRoot(), 58 | PaginationModule.forRoot(), 59 | PopoverModule.forRoot(), 60 | ProgressbarModule.forRoot(), 61 | TooltipModule.forRoot() 62 | ], 63 | declarations: [ 64 | CardsComponent, 65 | FormsComponent, 66 | SwitchesComponent, 67 | TablesComponent, 68 | TabsComponent, 69 | CarouselsComponent, 70 | CollapsesComponent, 71 | PaginationsComponent, 72 | PopoversComponent, 73 | ProgressComponent, 74 | TooltipsComponent 75 | ] 76 | }) 77 | export class BaseModule { } 78 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/progress.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | Bootstrap Progress 5 | 10 |
    11 |
    12 |
    13 |
    14 | 15 |
    16 |
    17 | 22% 18 |
    19 |
    20 | 166 / 200 21 |
    22 |
    23 |
    24 |
    25 |
    26 |
    27 | Progress dynamic 28 |
    29 |
    30 | 31 | {{dynamic}} / {{max}} 32 | 33 | 34 | No animation 35 | {{dynamic}}% 36 | 37 | Object (changes type based on value) 38 | 39 | {{type}} !!! Watch out !!! 40 | 41 |
    42 | 43 |
    44 |
    45 |
    46 |
    47 | Progress stacked 48 |
    49 |
    50 |
    51 | 52 |
    53 |
    54 |
    55 | 56 |
    57 |
    58 |
    59 |
    60 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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?.GetDisplayName(); 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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; 4 | import { LocationStrategy, HashLocationStrategy } from '@angular/common'; 5 | import { OAuthModule, AuthConfig } from 'angular-oauth2-oidc'; 6 | import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; 7 | import { PERFECT_SCROLLBAR_CONFIG } from 'ngx-perfect-scrollbar'; 8 | import { PerfectScrollbarConfigInterface } from 'ngx-perfect-scrollbar'; 9 | 10 | const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { 11 | suppressScrollX: true 12 | }; 13 | 14 | import { AppComponent } from './app.component'; 15 | 16 | // Import containers 17 | import { DefaultLayoutComponent } from './containers'; 18 | 19 | import { P404Component } from './views/error/404.component'; 20 | import { P500Component } from './views/error/500.component'; 21 | import { LoginComponent } from './views/login/login.component'; 22 | import { RegisterComponent } from './views/register/register.component'; 23 | import { UnauthorizedComponent } from './views/unauthorized/unauthorized.component'; 24 | import { LoginCallbackComponent } from './views/login/login-callback.component'; 25 | 26 | const APP_CONTAINERS = [ 27 | DefaultLayoutComponent 28 | ]; 29 | 30 | import { 31 | AppAsideModule, 32 | AppBreadcrumbModule, 33 | AppHeaderModule, 34 | AppFooterModule, 35 | AppSidebarModule, 36 | } from '@coreui/angular' 37 | 38 | // Import routing module 39 | import { AppRoutingModule } from './app.routing'; 40 | 41 | // Import 3rd party components 42 | import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; 43 | import { TabsModule } from 'ngx-bootstrap/tabs'; 44 | import { ChartsModule } from 'ng2-charts/ng2-charts'; 45 | 46 | 47 | @NgModule({ 48 | imports: [ 49 | BrowserModule, 50 | HttpClientModule, 51 | OAuthModule.forRoot({ 52 | resourceServer: { 53 | allowedUrls: ['http://localhost:5001'], 54 | sendAccessToken: true 55 | } 56 | }), 57 | AppRoutingModule, 58 | AppAsideModule, 59 | AppBreadcrumbModule.forRoot(), 60 | AppFooterModule, 61 | AppHeaderModule, 62 | AppSidebarModule, 63 | PerfectScrollbarModule, 64 | BsDropdownModule.forRoot(), 65 | TabsModule.forRoot(), 66 | ChartsModule, 67 | ], 68 | declarations: [ 69 | AppComponent, 70 | ...APP_CONTAINERS, 71 | P404Component, 72 | P500Component, 73 | LoginComponent, 74 | RegisterComponent, 75 | UnauthorizedComponent, // -- Feature from this project 76 | LoginCallbackComponent // -- Feature from this project 77 | ], 78 | bootstrap: [AppComponent] 79 | }) 80 | export class AppModule { } 81 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/notifications/alerts.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, SecurityContext, ViewEncapsulation } from '@angular/core'; 2 | import { DomSanitizer } from '@angular/platform-browser'; 3 | import { AlertConfig } from 'ngx-bootstrap/alert'; 4 | 5 | // such override allows to keep some initial values 6 | 7 | export function getAlertConfig(): AlertConfig { 8 | return Object.assign(new AlertConfig(), { type: 'success' }); 9 | } 10 | 11 | @Component({ 12 | templateUrl: 'alerts.component.html', 13 | encapsulation: ViewEncapsulation.None, 14 | styles: [ 15 | ` 16 | .alert-md-local { 17 | background-color: #009688; 18 | border-color: #00695C; 19 | color: #fff; 20 | } 21 | ` 22 | ], 23 | providers: [{ provide: AlertConfig, useFactory: getAlertConfig }] 24 | }) 25 | export class AlertsComponent { 26 | 27 | constructor(sanitizer: DomSanitizer) { 28 | this.alertsHtml = this.alertsHtml.map((alert: any) => ({ 29 | type: alert.type, 30 | msg: sanitizer.sanitize(SecurityContext.HTML, alert.msg) 31 | })); 32 | } 33 | dismissible = true; 34 | alerts: any = [ 35 | { 36 | type: 'success', 37 | msg: `You successfully read this important alert message.` 38 | }, 39 | { 40 | type: 'info', 41 | msg: `This alert needs your attention, but it's not super important.` 42 | }, 43 | { 44 | type: 'danger', 45 | msg: `Better check yourself, you're not looking too good.` 46 | } 47 | ]; 48 | 49 | reset(): void { 50 | this.alerts = this.alerts.map((alert: any) => Object.assign({}, alert)); 51 | } 52 | 53 | alertsHtml: any = [ 54 | { 55 | type: 'success', 56 | msg: `Well done! You successfully read this important alert message.` 57 | }, 58 | { 59 | type: 'info', 60 | msg: `Heads up! This alert needs your attention, but it's not super important.` 61 | }, 62 | { 63 | type: 'danger', 64 | msg: `Warning! Better check yourself, you're not looking too good.` 65 | } 66 | ]; 67 | 68 | index = 0; 69 | messages = [ 70 | 'You successfully read this important alert message.', 71 | 'Now this text is different from what it was before. Go ahead and click the button one more time', 72 | 'Well done! Click reset button and you\'ll see the first message' 73 | ]; 74 | 75 | changeText() { 76 | if (this.messages.length - 1 !== this.index) { 77 | this.index++; 78 | } 79 | } 80 | 81 | alertsDismiss: any = []; 82 | 83 | add(): void { 84 | this.alertsDismiss.push({ 85 | type: 'info', 86 | msg: `This alert will be closed in 5 seconds (added: ${new Date().toLocaleTimeString()})`, 87 | timeout: 5000 88 | }); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /AngularOIDC/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@coreui/coreui-free-angular-admin-template", 3 | "version": "2.0.0-rc.2", 4 | "description": "CoreUI Free Angular 2+ Admin Template", 5 | "author": { 6 | "name": "Łukasz Holeczek", 7 | "url": "http://holeczek.pl", 8 | "github": "https://github.com/mrholek", 9 | "twitter": "https://twitter.com/lukaszholeczek" 10 | }, 11 | "contributors": [ 12 | { 13 | "name": "Andrzej Kopański", 14 | "url": "https://github.com/xidedix" 15 | } 16 | ], 17 | "homepage": "https://coreui.io/angular", 18 | "copyright": "Copyright 2018 creativeLabs Łukasz Holeczek", 19 | "license": "MIT", 20 | "scripts": { 21 | "ng": "ng", 22 | "start": "ng serve", 23 | "build": "ng build --prod", 24 | "test": "ng test", 25 | "lint": "ng lint", 26 | "e2e": "ng e2e" 27 | }, 28 | "private": true, 29 | "dependencies": { 30 | "@angular/animations": "^6.0.9", 31 | "@angular/common": "^6.0.9", 32 | "@angular/compiler": "^6.0.9", 33 | "@angular/core": "^6.0.9", 34 | "@angular/forms": "^6.0.9", 35 | "@angular/http": "^6.0.9", 36 | "@angular/platform-browser": "^6.0.9", 37 | "@angular/platform-browser-dynamic": "^6.0.9", 38 | "@angular/router": "^6.0.9", 39 | "@coreui/angular": "^2.0.0-rc.1", 40 | "@coreui/coreui": "^2.0.4", 41 | "@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.2.0", 42 | "@coreui/icons": "^0.3.0", 43 | "angular-oauth2-oidc": "^4.0.2", 44 | "bootstrap": "^4.1.2", 45 | "chart.js": "^2.7.2", 46 | "core-js": "^2.5.7", 47 | "flag-icon-css": "^3.0.0", 48 | "font-awesome": "^4.7.0", 49 | "moment": "^2.22.2", 50 | "mutationobserver-shim": "^0.3.2", 51 | "ng2-charts": "^1.6.0", 52 | "ngx-bootstrap": "^3.0.1", 53 | "ngx-perfect-scrollbar": "^6.2.0", 54 | "rxjs": "^6.2.1", 55 | "rxjs-compat": "^6.2.1", 56 | "simple-line-icons": "^2.4.1", 57 | "ts-helpers": "^1.1.2", 58 | "zone.js": "^0.8.26" 59 | }, 60 | "devDependencies": { 61 | "@angular-devkit/build-angular": "^0.6.8", 62 | "@angular/cli": "^6.0.8", 63 | "@angular/compiler-cli": "^6.0.9", 64 | "@angular/language-service": "^6.0.9", 65 | "@types/jasmine": "^2.8.8", 66 | "@types/jasminewd2": "^2.0.3", 67 | "@types/node": "^10.3.4", 68 | "codelyzer": "^4.4.2", 69 | "jasmine-core": "^3.1.0", 70 | "jasmine-spec-reporter": "^4.2.1", 71 | "karma": "^2.0.3", 72 | "karma-chrome-launcher": "^2.2.0", 73 | "karma-coverage-istanbul-reporter": "^2.0.1", 74 | "karma-jasmine": "^1.1.2", 75 | "karma-jasmine-html-reporter": "^1.2.0", 76 | "protractor": "^5.3.2", 77 | "ts-node": "^6.1.1", 78 | "tslint": "^5.10.0", 79 | "typescript": "2.7.2" 80 | }, 81 | "engines": { 82 | "node": ">= 8.9.4", 83 | "npm": ">= 5.6.0" 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/app.routing.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | // Import Containers 5 | import { DefaultLayoutComponent } from './containers'; 6 | 7 | import { P404Component } from './views/error/404.component'; 8 | import { P500Component } from './views/error/500.component'; 9 | import { LoginComponent } from './views/login/login.component'; 10 | import { RegisterComponent } from './views/register/register.component'; 11 | import { UnauthorizedComponent } from './views/unauthorized/unauthorized.component'; 12 | import { AuthGuard } from './core/auth/auth.guard'; 13 | import { LoginCallbackComponent } from './views/login/login-callback.component'; 14 | 15 | export const routes: Routes = [ 16 | { path: '', redirectTo: 'login', pathMatch: 'full', }, 17 | { 18 | path: '404', 19 | component: P404Component, 20 | data: { 21 | title: 'Page 404' 22 | } 23 | }, 24 | { 25 | path: '500', 26 | component: P500Component, 27 | data: { 28 | title: 'Page 500' 29 | } 30 | }, 31 | { 32 | path: 'login', 33 | component: LoginComponent, 34 | data: { 35 | title: 'Login Page' 36 | } 37 | }, 38 | { 39 | path: 'register', 40 | component: RegisterComponent, 41 | data: { 42 | title: 'Register Page' 43 | } 44 | }, 45 | { // -- Feature from this project 46 | path: 'login-callback', 47 | component: LoginCallbackComponent, 48 | data: { 49 | title: 'Login Page' 50 | } 51 | }, 52 | { // -- Feature from this project 53 | path: 'unauthorized', 54 | component: UnauthorizedComponent, 55 | data: { 56 | title: 'Unauthorized Page' 57 | } 58 | }, 59 | { 60 | path: '', 61 | component: DefaultLayoutComponent, 62 | canActivate: [AuthGuard], // -- Feature from this project 63 | data: { 64 | title: 'Home' 65 | }, 66 | children: [ 67 | { path: 'cotacao', loadChildren: './views/cotacao/cotacao.module#CotacaoModule' }, 68 | { path: 'base', loadChildren: './views/base/base.module#BaseModule' }, 69 | { path: 'buttons', loadChildren: './views/buttons/buttons.module#ButtonsModule' }, 70 | { path: 'charts', loadChildren: './views/chartjs/chartjs.module#ChartJSModule' }, 71 | { path: 'dashboard', loadChildren: './views/dashboard/dashboard.module#DashboardModule' }, 72 | { path: 'icons', loadChildren: './views/icons/icons.module#IconsModule' }, 73 | { path: 'notifications', loadChildren: './views/notifications/notifications.module#NotificationsModule' }, 74 | { path: 'theme', loadChildren: './views/theme/theme.module#ThemeModule' }, 75 | { path: 'widgets', loadChildren: './views/widgets/widgets.module#WidgetsModule' } 76 | ] 77 | } 78 | ]; 79 | 80 | @NgModule({ 81 | imports: [RouterModule.forRoot(routes)], 82 | providers: [AuthGuard], // -- AQUI 83 | exports: [RouterModule] 84 | }) 85 | export class AppRoutingModule { } 86 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options 18 | if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Type-Options")) 19 | { 20 | context.HttpContext.Response.Headers.Add("X-Content-Type-Options", "nosniff"); 21 | } 22 | 23 | // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options 24 | if (!context.HttpContext.Response.Headers.ContainsKey("X-Frame-Options")) 25 | { 26 | context.HttpContext.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN"); 27 | } 28 | 29 | // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy 30 | var csp = "default-src 'self'; object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts; base-uri 'self';"; 31 | // also consider adding upgrade-insecure-requests once you have HTTPS in place for production 32 | //csp += "upgrade-insecure-requests;"; 33 | // also an example if you need client images to be displayed from twitter 34 | // csp += "img-src 'self' https://pbs.twimg.com;"; 35 | 36 | // once for standards compliant browsers 37 | if (!context.HttpContext.Response.Headers.ContainsKey("Content-Security-Policy")) 38 | { 39 | context.HttpContext.Response.Headers.Add("Content-Security-Policy", csp); 40 | } 41 | // and once again for IE 42 | if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Security-Policy")) 43 | { 44 | context.HttpContext.Response.Headers.Add("X-Content-Security-Policy", csp); 45 | } 46 | 47 | // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy 48 | var referrer_policy = "no-referrer"; 49 | if (!context.HttpContext.Response.Headers.ContainsKey("Referrer-Policy")) 50 | { 51 | context.HttpContext.Response.Headers.Add("Referrer-Policy", referrer_policy); 52 | } 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/base-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { CardsComponent } from './cards.component'; 5 | import { FormsComponent } from './forms.component'; 6 | import { SwitchesComponent } from './switches.component'; 7 | import { TablesComponent } from './tables.component'; 8 | import { TabsComponent } from './tabs.component'; 9 | import { CarouselsComponent } from './carousels.component'; 10 | import { CollapsesComponent } from './collapses.component'; 11 | import { PaginationsComponent } from './paginations.component'; 12 | import {PopoversComponent} from './popovers.component'; 13 | import {ProgressComponent} from './progress.component'; 14 | import {TooltipsComponent} from './tooltips.component'; 15 | 16 | const routes: Routes = [ 17 | { 18 | path: '', 19 | data: { 20 | title: 'Base' 21 | }, 22 | children: [ 23 | { 24 | path: 'cards', 25 | component: CardsComponent, 26 | data: { 27 | title: 'Cards' 28 | } 29 | }, 30 | { 31 | path: 'forms', 32 | component: FormsComponent, 33 | data: { 34 | title: 'Forms' 35 | } 36 | }, 37 | { 38 | path: 'switches', 39 | component: SwitchesComponent, 40 | data: { 41 | title: 'Switches' 42 | } 43 | }, 44 | { 45 | path: 'tables', 46 | component: TablesComponent, 47 | data: { 48 | title: 'Tables' 49 | } 50 | }, 51 | { 52 | path: 'tabs', 53 | component: TabsComponent, 54 | data: { 55 | title: 'Tabs' 56 | } 57 | }, 58 | { 59 | path: 'carousels', 60 | component: CarouselsComponent, 61 | data: { 62 | title: 'Carousels' 63 | } 64 | }, 65 | { 66 | path: 'collapses', 67 | component: CollapsesComponent, 68 | data: { 69 | title: 'Collapses' 70 | } 71 | }, 72 | { 73 | path: 'paginations', 74 | component: PaginationsComponent, 75 | data: { 76 | title: 'Pagination' 77 | } 78 | }, 79 | { 80 | path: 'popovers', 81 | component: PopoversComponent, 82 | data: { 83 | title: 'Popover' 84 | } 85 | }, 86 | { 87 | path: 'progress', 88 | component: ProgressComponent, 89 | data: { 90 | title: 'Progress' 91 | } 92 | }, 93 | { 94 | path: 'tooltips', 95 | component: TooltipsComponent, 96 | data: { 97 | title: 'Tooltips' 98 | } 99 | } 100 | ] 101 | } 102 | ]; 103 | 104 | @NgModule({ 105 | imports: [RouterModule.forChild(routes)], 106 | exports: [RouterModule] 107 | }) 108 | export class BaseRoutingModule {} 109 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 |
    -------------------------------------------------------------------------------- /AngularOIDC/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | import 'core-js/es6/symbol'; 23 | import 'core-js/es6/object'; 24 | import 'core-js/es6/function'; 25 | import 'core-js/es6/parse-int'; 26 | import 'core-js/es6/parse-float'; 27 | import 'core-js/es6/number'; 28 | import 'core-js/es6/math'; 29 | import 'core-js/es6/string'; 30 | import 'core-js/es6/date'; 31 | import 'core-js/es6/array'; 32 | import 'core-js/es6/regexp'; 33 | import 'core-js/es6/map'; 34 | import 'core-js/es6/weak-map'; 35 | import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | // for IE10 49 | import 'mutationobserver-shim' 50 | 51 | /** 52 | * Required to support Web Animations `@angular/platform-browser/animations`. 53 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 54 | **/ 55 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 56 | 57 | /** 58 | * By default, zone.js will patch all possible macroTask and DomEvents 59 | * user can disable parts of macroTask/DomEvents patch by setting following flags 60 | */ 61 | 62 | (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 63 | (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 64 | (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 65 | (window as any).__Zone_enable_cross_context_check = true; 66 | 67 | /* 68 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 69 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 70 | */ 71 | (window as any).__Zone_enable_cross_context_check = true; 72 | 73 | /*************************************************************************************************** 74 | * Zone JS is required by default for Angular itself. 75 | */ 76 | import 'zone.js/dist/zone'; // Included with Angular CLI. 77 | 78 | 79 | 80 | /*************************************************************************************************** 81 | * APPLICATION IMPORTS 82 | */ 83 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Consent/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model ConsentViewModel 2 | 3 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/chartjs/chartjs.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: 'chartjs.component.html' 5 | }) 6 | export class ChartJSComponent { 7 | 8 | // lineChart 9 | public lineChartData: Array = [ 10 | {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'}, 11 | {data: [28, 48, 40, 19, 86, 27, 90], label: 'Series B'}, 12 | {data: [18, 48, 77, 9, 100, 27, 40], label: 'Series C'} 13 | ]; 14 | public lineChartLabels: Array = ['January', 'February', 'March', 'April', 'May', 'June', 'July']; 15 | public lineChartOptions: any = { 16 | animation: false, 17 | responsive: true 18 | }; 19 | public lineChartColours: Array = [ 20 | { // grey 21 | backgroundColor: 'rgba(148,159,177,0.2)', 22 | borderColor: 'rgba(148,159,177,1)', 23 | pointBackgroundColor: 'rgba(148,159,177,1)', 24 | pointBorderColor: '#fff', 25 | pointHoverBackgroundColor: '#fff', 26 | pointHoverBorderColor: 'rgba(148,159,177,0.8)' 27 | }, 28 | { // dark grey 29 | backgroundColor: 'rgba(77,83,96,0.2)', 30 | borderColor: 'rgba(77,83,96,1)', 31 | pointBackgroundColor: 'rgba(77,83,96,1)', 32 | pointBorderColor: '#fff', 33 | pointHoverBackgroundColor: '#fff', 34 | pointHoverBorderColor: 'rgba(77,83,96,1)' 35 | }, 36 | { // grey 37 | backgroundColor: 'rgba(148,159,177,0.2)', 38 | borderColor: 'rgba(148,159,177,1)', 39 | pointBackgroundColor: 'rgba(148,159,177,1)', 40 | pointBorderColor: '#fff', 41 | pointHoverBackgroundColor: '#fff', 42 | pointHoverBorderColor: 'rgba(148,159,177,0.8)' 43 | } 44 | ]; 45 | public lineChartLegend = true; 46 | public lineChartType = 'line'; 47 | 48 | // barChart 49 | public barChartOptions: any = { 50 | scaleShowVerticalLines: false, 51 | responsive: true 52 | }; 53 | public barChartLabels: string[] = ['2006', '2007', '2008', '2009', '2010', '2011', '2012']; 54 | public barChartType = 'bar'; 55 | public barChartLegend = true; 56 | 57 | public barChartData: any[] = [ 58 | {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'}, 59 | {data: [28, 48, 40, 19, 86, 27, 90], label: 'Series B'} 60 | ]; 61 | 62 | // Doughnut 63 | public doughnutChartLabels: string[] = ['Download Sales', 'In-Store Sales', 'Mail-Order Sales']; 64 | public doughnutChartData: number[] = [350, 450, 100]; 65 | public doughnutChartType = 'doughnut'; 66 | 67 | // Radar 68 | public radarChartLabels: string[] = ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running']; 69 | 70 | public radarChartData: any = [ 71 | {data: [65, 59, 90, 81, 56, 55, 40], label: 'Series A'}, 72 | {data: [28, 48, 40, 19, 96, 27, 100], label: 'Series B'} 73 | ]; 74 | public radarChartType = 'radar'; 75 | 76 | // Pie 77 | public pieChartLabels: string[] = ['Download Sales', 'In-Store Sales', 'Mail Sales']; 78 | public pieChartData: number[] = [300, 500, 100]; 79 | public pieChartType = 'pie'; 80 | 81 | // PolarArea 82 | public polarAreaChartLabels: string[] = ['Download Sales', 'In-Store Sales', 'Mail Sales', 'Telesales', 'Corporate Sales']; 83 | public polarAreaChartData: number[] = [300, 500, 100, 40, 120]; 84 | public polarAreaLegend = true; 85 | 86 | public polarAreaChartType = 'polarArea'; 87 | 88 | // events 89 | public chartClicked(e: any): void { 90 | console.log(e); 91 | } 92 | 93 | public chartHovered(e: any): void { 94 | console.log(e); 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/base/paginations.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | Bootstrap Pagination 5 | 10 |
    11 |
    12 |
    13 |
    14 | 15 |
    16 |
    17 | 19 |
    20 |
    21 | 23 |
    24 |
    25 | 27 |
    28 |
    29 |
    The selected page no: {{currentPage}}/{{smallnumPages}}
    30 |
    31 | 34 |
    35 |
    36 |
    37 | Pagination states & limits 38 |
    39 |
    40 |
    41 |
    42 | 44 |
    45 | 46 |
    47 | 50 |
    51 |
    52 |
    Page: {{bigCurrentPage}} / {{numPages}}
    53 |
    54 |
    55 |
    56 |
    57 | Pager 58 |
    59 |
    60 |
    61 |
    62 | 67 | 68 |
    69 | 70 |
    71 | 78 | 79 |
    80 |
    81 |
    82 |
    83 |
    84 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/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 | using IdentityServer4.Events; 13 | using IdentityServer4.Extensions; 14 | 15 | namespace IdentityServer4.Quickstart.UI 16 | { 17 | /// 18 | /// This sample controller allows a user to revoke grants given to clients 19 | /// 20 | [SecurityHeaders] 21 | [Authorize] 22 | public class GrantsController : Controller 23 | { 24 | private readonly IIdentityServerInteractionService _interaction; 25 | private readonly IClientStore _clients; 26 | private readonly IResourceStore _resources; 27 | private readonly IEventService _events; 28 | 29 | public GrantsController(IIdentityServerInteractionService interaction, 30 | IClientStore clients, 31 | IResourceStore resources, 32 | IEventService events) 33 | { 34 | _interaction = interaction; 35 | _clients = clients; 36 | _resources = resources; 37 | _events = events; 38 | } 39 | 40 | /// 41 | /// Show list of grants 42 | /// 43 | [HttpGet] 44 | public async Task Index() 45 | { 46 | return View("Index", await BuildViewModelAsync()); 47 | } 48 | 49 | /// 50 | /// Handle postback to revoke a client 51 | /// 52 | [HttpPost] 53 | [ValidateAntiForgeryToken] 54 | public async Task Revoke(string clientId) 55 | { 56 | await _interaction.RevokeUserConsentAsync(clientId); 57 | await _events.RaiseAsync(new GrantsRevokedEvent(User.GetSubjectId(), clientId)); 58 | 59 | return RedirectToAction("Index"); 60 | } 61 | 62 | private async Task BuildViewModelAsync() 63 | { 64 | var grants = await _interaction.GetAllUserConsentsAsync(); 65 | 66 | var list = new List(); 67 | foreach(var grant in grants) 68 | { 69 | var client = await _clients.FindClientByIdAsync(grant.ClientId); 70 | if (client != null) 71 | { 72 | var resources = await _resources.FindResourcesByScopeAsync(grant.Scopes); 73 | 74 | var item = new GrantViewModel() 75 | { 76 | ClientId = client.ClientId, 77 | ClientName = client.ClientName ?? client.ClientId, 78 | ClientLogoUrl = client.LogoUri, 79 | ClientUrl = client.ClientUri, 80 | Created = grant.CreationTime, 81 | Expires = grant.Expiration, 82 | IdentityGrantNames = resources.IdentityResources.Select(x => x.DisplayName ?? x.Name).ToArray(), 83 | ApiGrantNames = resources.ApiResources.Select(x => x.DisplayName ?? x.Name).ToArray() 84 | }; 85 | 86 | list.Add(item); 87 | } 88 | } 89 | 90 | return new GrantsViewModel 91 | { 92 | Grants = list 93 | }; 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /AngularOIDC/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-use-before-declare": true, 76 | "no-var-keyword": true, 77 | "object-literal-sort-keys": false, 78 | "one-line": [ 79 | true, 80 | "check-open-brace", 81 | "check-catch", 82 | "check-else", 83 | "check-whitespace" 84 | ], 85 | "prefer-const": true, 86 | "quotemark": [ 87 | true, 88 | "single" 89 | ], 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always" 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "unified-signatures": true, 110 | "variable-name": false, 111 | "whitespace": [ 112 | true, 113 | "check-branch", 114 | "check-decl", 115 | "check-operator", 116 | "check-separator", 117 | "check-type" 118 | ], 119 | "directive-selector": [ 120 | true, 121 | "attribute", 122 | "app", 123 | "camelCase" 124 | ], 125 | "component-selector": [ 126 | true, 127 | "element", 128 | "app", 129 | "kebab-case" 130 | ], 131 | "no-output-on-prefix": true, 132 | "use-input-property-decorator": true, 133 | "use-output-property-decorator": true, 134 | "use-host-property-decorator": true, 135 | "no-input-rename": true, 136 | "no-output-rename": true, 137 | "use-life-cycle-interface": true, 138 | "use-pipe-transform-interface": true, 139 | "component-class-suffix": true, 140 | "directive-class-suffix": true 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/notifications/badges.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 |
    6 | Bootstrap Badges 7 | 12 |
    13 |
    14 |

    Example heading 15 | New 16 |

    17 |

    Example heading 18 | New 19 |

    20 |

    Example heading 21 | New 22 |

    23 |

    Example heading 24 | New 25 |

    26 |
    Example heading 27 | New 28 |
    29 |
    Example heading 30 | New 31 |
    32 |
    33 | 38 |
    39 |
    40 |
    41 |
    42 |
    43 | Bootstrap Badges 44 | contextual variations 45 |
    46 |
    47 | Primary 48 | Secondary 49 | Success 50 | Danger 51 | Warning 52 | Info 53 | Light 54 | Dark 55 |
    56 |
    57 |
    58 |
    59 | Bootstrap Badges 60 | pill badges 61 |
    62 |
    63 | Primary 64 | Secondary 65 | Success 66 | Danger 67 | Warning 68 | Info 69 | Light 70 | Dark 71 |
    72 |
    73 |
    74 |
    75 | Bootstrap Badges 76 | links 77 |
    78 |
    79 | Primary 80 | Secondary 81 | Success 82 | Danger 83 | Warning 84 | Info 85 | Light 86 | Dark 87 |
    88 |
    89 |
    90 |
    91 | 92 |
    93 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Views/Account/Login.cshtml: -------------------------------------------------------------------------------- 1 | @model LoginViewModel 2 | 3 | -------------------------------------------------------------------------------- /AngularOIDC/src/assets/img/brand/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 25 | 32 | 37 | 38 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /IdentityServer4AngularOIDC/Config.cs: -------------------------------------------------------------------------------- 1 | using IdentityModel; 2 | using IdentityServer4; 3 | using IdentityServer4.Models; 4 | using IdentityServer4.Test; 5 | using System.Collections.Generic; 6 | using System.Security.Claims; 7 | 8 | namespace Server 9 | { 10 | public class Config 11 | { 12 | // scopes define the resources in your system 13 | public static IEnumerable GetIdentityResources() 14 | { 15 | return new List 16 | { 17 | new IdentityResources.OpenId(), 18 | new IdentityResources.Profile(), 19 | new IdentityResources.Email() 20 | }; 21 | } 22 | 23 | public static IEnumerable GetApiResources() 24 | { 25 | return new List 26 | { 27 | new ApiResource("apiFinanceiro", "Meu WebApi Financeiro") 28 | }; 29 | } 30 | 31 | // clients want to access resources (aka scopes) 32 | public static IEnumerable GetClients() 33 | { 34 | // client credentials client 35 | return new List 36 | { 37 | // OpenID Connect implicit flow client (MVC 38 | new Client { 39 | ClientId = "angularoidc", 40 | ClientName = "Angular OpenId Connect", 41 | //AccessTokenLifetime = 600, // 10 minutes, default 60 minutes 42 | AllowedGrantTypes = GrantTypes.Implicit, 43 | AllowAccessTokensViaBrowser = true, 44 | RequireConsent = false, 45 | RedirectUris = { "http://localhost:4200/login-callback" }, 46 | PostLogoutRedirectUris = { "http://localhost:4200/" }, 47 | AllowedCorsOrigins = { "http://localhost:4200" }, 48 | AllowedScopes = 49 | { 50 | IdentityServerConstants.StandardScopes.OpenId, 51 | IdentityServerConstants.StandardScopes.Profile, 52 | IdentityServerConstants.StandardScopes.Email, 53 | "apiFinanceiro" 54 | } 55 | } 56 | }; 57 | } 58 | 59 | public static List GetUsers() 60 | { 61 | return new List 62 | { 63 | new TestUser 64 | { 65 | SubjectId = "1", 66 | Username = "bruno", 67 | Password = "1234", 68 | 69 | Claims = new List 70 | { 71 | new Claim("name", "Bruno"), 72 | new Claim(JwtClaimTypes.GivenName, "Bruno Brito"), 73 | new Claim(JwtClaimTypes.FamilyName, "Brito"), 74 | new Claim(JwtClaimTypes.Email, "bhdebrito@gmail.com"), 75 | new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), 76 | new Claim(JwtClaimTypes.WebSite, "http://www.brunobrito.net.br"), 77 | new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'Av Paulista', 'locality': 'Sao Paulo', 'postal_code': 03323040, 'country': 'Brazil' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json) 78 | 79 | } 80 | }, 81 | new TestUser 82 | { 83 | SubjectId = "2", 84 | Username = "jp", 85 | Password = "1234", 86 | 87 | Claims = new List 88 | { 89 | new Claim("name", "JP"), 90 | new Claim(JwtClaimTypes.GivenName, "Joao Pedro"), 91 | new Claim(JwtClaimTypes.FamilyName, "Silva"), 92 | new Claim(JwtClaimTypes.Email, "jp@email.com"), 93 | new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), 94 | new Claim(JwtClaimTypes.WebSite, "http://globo.com"), 95 | new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'Rua da Consolacao', 'locality': 'Sao Paulo', 'postal_code': 02565333, 'country': 'Brasil' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json), 96 | new Claim("location", "Brazil") 97 | } 98 | } 99 | }; 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /AngularOIDC/src/app/views/chartjs/chartjs.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 | Line Chart 6 | 11 |
    12 |
    13 |
    14 | 23 |
    24 |
    25 |
    26 |
    27 |
    28 | Bar Chart 29 | 34 |
    35 |
    36 |
    37 | 45 |
    46 |
    47 |
    48 |
    49 |
    50 | Doughnut Chart 51 | 56 |
    57 |
    58 |
    59 | 65 |
    66 |
    67 |
    68 |
    69 |
    70 | Radar Chart 71 | 76 |
    77 |
    78 |
    79 | 85 |
    86 |
    87 |
    88 |
    89 |
    90 | Pie Chart 91 | 96 |
    97 |
    98 |
    99 | 105 |
    106 |
    107 |
    108 |
    109 |
    110 | Polar Area Chart 111 |
    112 | 113 | docs 114 | 115 |
    116 |
    117 |
    118 |
    119 | 126 |
    127 |
    128 |
    129 |
    130 |
    131 | -------------------------------------------------------------------------------- /AngularOIDC/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "ng": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "architect": { 11 | "build": { 12 | "builder": "@angular-devkit/build-angular:browser", 13 | "options": { 14 | "outputPath": "dist", 15 | "index": "src/index.html", 16 | "main": "src/main.ts", 17 | "tsConfig": "src/tsconfig.app.json", 18 | "polyfills": "src/polyfills.ts", 19 | "assets": [ 20 | "src/assets" 21 | ], 22 | "styles": [ 23 | "node_modules/@coreui/icons/css/coreui-icons.css", 24 | "node_modules/flag-icon-css/css/flag-icon.css", 25 | "node_modules/font-awesome/css/font-awesome.css", 26 | "node_modules/simple-line-icons/css/simple-line-icons.css", 27 | "src/scss/style.scss" 28 | ], 29 | "stylePreprocessorOptions": { 30 | "includePaths": ["./node_modules"] 31 | }, 32 | "scripts": [ 33 | "node_modules/chart.js/dist/Chart.min.js" 34 | ] 35 | }, 36 | "configurations": { 37 | "production": { 38 | "optimization": true, 39 | "outputHashing": "all", 40 | "sourceMap": false, 41 | "extractCss": true, 42 | "namedChunks": false, 43 | "aot": true, 44 | "extractLicenses": true, 45 | "vendorChunk": false, 46 | "buildOptimizer": true, 47 | "fileReplacements": [ 48 | { 49 | "replace": "src/environments/environment.ts", 50 | "with": "src/environments/environment.prod.ts" 51 | } 52 | ] 53 | } 54 | } 55 | }, 56 | "serve": { 57 | "builder": "@angular-devkit/build-angular:dev-server", 58 | "options": { 59 | "browserTarget": "ng:build" 60 | }, 61 | "configurations": { 62 | "production": { 63 | "browserTarget": "ng:build:production" 64 | } 65 | } 66 | }, 67 | "extract-i18n": { 68 | "builder": "@angular-devkit/build-angular:extract-i18n", 69 | "options": { 70 | "browserTarget": "ng:build" 71 | } 72 | }, 73 | "test": { 74 | "builder": "@angular-devkit/build-angular:karma", 75 | "options": { 76 | "main": "src/test.ts", 77 | "karmaConfig": "./karma.conf.js", 78 | "polyfills": "src/polyfills.ts", 79 | "tsConfig": "src/tsconfig.spec.json", 80 | "scripts": [ 81 | "node_modules/chart.js/dist/Chart.min.js" 82 | ], 83 | "styles": [ 84 | "node_modules/flag-icon-css/css/flag-icon.css", 85 | "node_modules/font-awesome/css/font-awesome.css", 86 | "node_modules/simple-line-icons/css/simple-line-icons.css", 87 | "src/scss/style.scss" 88 | ], 89 | "stylePreprocessorOptions": { 90 | "includePaths": ["./node_modules"] 91 | }, 92 | "assets": [ 93 | "src/assets", 94 | "src/favicon.ico" 95 | ] 96 | } 97 | }, 98 | "lint": { 99 | "builder": "@angular-devkit/build-angular:tslint", 100 | "options": { 101 | "tsConfig": [ 102 | "src/tsconfig.app.json", 103 | "src/tsconfig.spec.json" 104 | ], 105 | "exclude": [ 106 | "**/node_modules/**" 107 | ] 108 | } 109 | } 110 | } 111 | }, 112 | "ng-e2e": { 113 | "root": "", 114 | "sourceRoot": "", 115 | "projectType": "application", 116 | "architect": { 117 | "e2e": { 118 | "builder": "@angular-devkit/build-angular:protractor", 119 | "options": { 120 | "protractorConfig": "./protractor.conf.js", 121 | "devServerTarget": "ng:serve" 122 | } 123 | }, 124 | "lint": { 125 | "builder": "@angular-devkit/build-angular:tslint", 126 | "options": { 127 | "tsConfig": [ 128 | "e2e/tsconfig.e2e.json" 129 | ], 130 | "exclude": [ 131 | "**/node_modules/**" 132 | ] 133 | } 134 | } 135 | } 136 | } 137 | }, 138 | "defaultProject": "ng", 139 | "schematics": { 140 | "@schematics/angular:component": { 141 | "prefix": "app", 142 | "styleext": "scss" 143 | }, 144 | "@schematics/angular:directive": { 145 | "prefix": "app" 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /AngularOIDC/src/app/_nav.ts: -------------------------------------------------------------------------------- 1 | export const navItems = [ 2 | { 3 | name: 'Dashboard', 4 | url: '/dashboard', 5 | icon: 'icon-speedometer', 6 | badge: { 7 | variant: 'info', 8 | text: 'NEW' 9 | } 10 | }, 11 | { 12 | name: 'Cotacao', 13 | url: '/cotacao', 14 | icon: 'icon-speedometer', 15 | badge: { 16 | variant: 'info', 17 | text: 'criptoservices' 18 | } 19 | }, 20 | { 21 | title: true, 22 | name: 'Theme' 23 | }, 24 | { 25 | name: 'Colors', 26 | url: '/theme/colors', 27 | icon: 'icon-drop' 28 | }, 29 | { 30 | name: 'Typography', 31 | url: '/theme/typography', 32 | icon: 'icon-pencil' 33 | }, 34 | { 35 | title: true, 36 | name: 'Components' 37 | }, 38 | { 39 | name: 'Base', 40 | url: '/base', 41 | icon: 'icon-puzzle', 42 | children: [ 43 | { 44 | name: 'Cards', 45 | url: '/base/cards', 46 | icon: 'icon-puzzle' 47 | }, 48 | { 49 | name: 'Carousels', 50 | url: '/base/carousels', 51 | icon: 'icon-puzzle' 52 | }, 53 | { 54 | name: 'Collapses', 55 | url: '/base/collapses', 56 | icon: 'icon-puzzle' 57 | }, 58 | { 59 | name: 'Forms', 60 | url: '/base/forms', 61 | icon: 'icon-puzzle' 62 | }, 63 | { 64 | name: 'Pagination', 65 | url: '/base/paginations', 66 | icon: 'icon-puzzle' 67 | }, 68 | { 69 | name: 'Popovers', 70 | url: '/base/popovers', 71 | icon: 'icon-puzzle' 72 | }, 73 | { 74 | name: 'Progress', 75 | url: '/base/progress', 76 | icon: 'icon-puzzle' 77 | }, 78 | { 79 | name: 'Switches', 80 | url: '/base/switches', 81 | icon: 'icon-puzzle' 82 | }, 83 | { 84 | name: 'Tables', 85 | url: '/base/tables', 86 | icon: 'icon-puzzle' 87 | }, 88 | { 89 | name: 'Tabs', 90 | url: '/base/tabs', 91 | icon: 'icon-puzzle' 92 | }, 93 | { 94 | name: 'Tooltips', 95 | url: '/base/tooltips', 96 | icon: 'icon-puzzle' 97 | } 98 | ] 99 | }, 100 | { 101 | name: 'Buttons', 102 | url: '/buttons', 103 | icon: 'icon-cursor', 104 | children: [ 105 | { 106 | name: 'Buttons', 107 | url: '/buttons/buttons', 108 | icon: 'icon-cursor' 109 | }, 110 | { 111 | name: 'Dropdowns', 112 | url: '/buttons/dropdowns', 113 | icon: 'icon-cursor' 114 | }, 115 | { 116 | name: 'Brand Buttons', 117 | url: '/buttons/brand-buttons', 118 | icon: 'icon-cursor' 119 | } 120 | ] 121 | }, 122 | { 123 | name: 'Charts', 124 | url: '/charts', 125 | icon: 'icon-pie-chart' 126 | }, 127 | { 128 | name: 'Icons', 129 | url: '/icons', 130 | icon: 'icon-star', 131 | children: [ 132 | { 133 | name: 'CoreUI Icons', 134 | url: '/icons/coreui-icons', 135 | icon: 'icon-star', 136 | badge: { 137 | variant: 'success', 138 | text: 'NEW' 139 | } 140 | }, 141 | { 142 | name: 'Flags', 143 | url: '/icons/flags', 144 | icon: 'icon-star' 145 | }, 146 | { 147 | name: 'Font Awesome', 148 | url: '/icons/font-awesome', 149 | icon: 'icon-star', 150 | badge: { 151 | variant: 'secondary', 152 | text: '4.7' 153 | } 154 | }, 155 | { 156 | name: 'Simple Line Icons', 157 | url: '/icons/simple-line-icons', 158 | icon: 'icon-star' 159 | } 160 | ] 161 | }, 162 | { 163 | name: 'Notifications', 164 | url: '/notifications', 165 | icon: 'icon-bell', 166 | children: [ 167 | { 168 | name: 'Alerts', 169 | url: '/notifications/alerts', 170 | icon: 'icon-bell' 171 | }, 172 | { 173 | name: 'Badges', 174 | url: '/notifications/badges', 175 | icon: 'icon-bell' 176 | }, 177 | { 178 | name: 'Modals', 179 | url: '/notifications/modals', 180 | icon: 'icon-bell' 181 | } 182 | ] 183 | }, 184 | { 185 | name: 'Widgets', 186 | url: '/widgets', 187 | icon: 'icon-calculator', 188 | badge: { 189 | variant: 'info', 190 | text: 'NEW' 191 | } 192 | }, 193 | { 194 | divider: true 195 | }, 196 | { 197 | title: true, 198 | name: 'Extras', 199 | }, 200 | { 201 | name: 'Pages', 202 | url: '/pages', 203 | icon: 'icon-star', 204 | children: [ 205 | { 206 | name: 'Login', 207 | url: '/login', 208 | icon: 'icon-star' 209 | }, 210 | { 211 | name: 'Register', 212 | url: '/register', 213 | icon: 'icon-star' 214 | }, 215 | { 216 | name: 'Error 404', 217 | url: '/404', 218 | icon: 'icon-star' 219 | }, 220 | { 221 | name: 'Error 500', 222 | url: '/500', 223 | icon: 'icon-star' 224 | } 225 | ] 226 | }, 227 | { 228 | name: 'Download CoreUI', 229 | url: 'http://coreui.io/angular/', 230 | icon: 'icon-cloud-download', 231 | class: 'mt-auto', 232 | variant: 'success' 233 | }, 234 | { 235 | name: 'Try CoreUI PRO', 236 | url: 'http://coreui.io/pro/angular/', 237 | icon: 'icon-layers', 238 | variant: 'danger' 239 | } 240 | ]; 241 | --------------------------------------------------------------------------------