├── .editorconfig ├── .gitignore ├── GitVersion.yml ├── LICENSE ├── Orleans.Security.Build.sln ├── Orleans.Security.sln ├── Orleans.Security.sln.DotSettings ├── README.md ├── azure-pipelines.yml ├── docs-builder ├── .stylelintrc.json ├── .travis.yml ├── 404.html ├── CODE_OF_CONDUCT.md ├── Gemfile ├── Index1.jpg ├── Index2.jpg ├── LICENSE.txt ├── README.md ├── Rakefile ├── _config.yml ├── _includes │ ├── head.html │ ├── head_custom.html │ ├── js │ │ └── custom.js │ ├── nav.html │ ├── title.html │ └── vendor │ │ └── anchor_headings.html ├── _layouts │ ├── about.html │ ├── default.html │ ├── home.html │ ├── page.html │ ├── post.html │ ├── table_wrappers.html │ └── vendor │ │ └── compress.html ├── _sass │ ├── base.scss │ ├── buttons.scss │ ├── code.scss │ ├── color_schemes │ │ └── dark.scss │ ├── content.scss │ ├── custom │ │ └── custom.scss │ ├── labels.scss │ ├── layout.scss │ ├── navigation.scss │ ├── overrides.scss │ ├── search.scss │ ├── support │ │ ├── _functions.scss │ │ ├── _variables.scss │ │ ├── mixins │ │ │ ├── _buttons.scss │ │ │ ├── _layout.scss │ │ │ ├── _typography.scss │ │ │ └── mixins.scss │ │ └── support.scss │ ├── tables.scss │ ├── typography.scss │ ├── utilities │ │ ├── _colors.scss │ │ ├── _layout.scss │ │ ├── _lists.scss │ │ ├── _spacing.scss │ │ ├── _typography.scss │ │ └── utilities.scss │ └── vendor │ │ └── normalize.scss │ │ ├── README.md │ │ ├── normalize.scss │ │ └── package.json ├── assets │ ├── css │ │ ├── dark-mode-preview.scss │ │ └── just-the-docs.scss │ ├── images │ │ ├── just-the-docs.png │ │ └── search.svg │ └── js │ │ ├── dark-mode-preview.js │ │ ├── just-the-docs.js │ │ ├── search-data.json │ │ └── vendor │ │ └── lunr.min.js ├── bin │ └── just-the-docs ├── docs │ ├── authorization │ │ ├── authorization.md │ │ ├── claims-based-authorization.md │ │ ├── overview.md │ │ ├── policy-based-authorization.md │ │ ├── resource-based-authorization.md │ │ ├── role-based-authorization.md │ │ └── simple-authorization.md │ └── releases │ │ ├── releases.md │ │ └── version-1-1.md ├── index.md ├── just-the-docs.gemspec ├── lib │ └── tasks │ │ └── search.rake ├── package-lock.json ├── package.json ├── resources │ ├── Drawing1.vsdx │ └── Drawing2.vsdx └── script │ └── build ├── docs ├── 404.html ├── CNAME ├── CODE_OF_CONDUCT.md ├── Index1.jpg ├── Index2.jpg ├── assets │ ├── css │ │ ├── dark-mode-preview.css │ │ └── just-the-docs.css │ ├── images │ │ ├── just-the-docs.png │ │ └── search.svg │ └── js │ │ ├── dark-mode-preview.js │ │ ├── just-the-docs.js │ │ ├── search-data.json │ │ └── vendor │ │ └── lunr.min.js ├── docs │ ├── authorization.html │ ├── authorization │ │ ├── claims-based-authorization.html │ │ ├── overview.html │ │ ├── policy-based-authorization.html │ │ ├── resource-based-authorization.html │ │ ├── role-based-authorization.html │ │ └── simple-authorization.html │ ├── releases.html │ └── releases │ │ └── version-1-1.html ├── index.html └── resources │ ├── Drawing1.vsdx │ └── Drawing2.vsdx ├── samples ├── aspnetcore-co-hosting │ ├── ApiAndSiloHost │ │ ├── ApiAndSiloHost.csproj │ │ ├── Controllers │ │ │ └── UserController.cs │ │ ├── Orleans │ │ │ └── AspNetCoreAccessTokenProvider.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── Grains │ │ ├── AuthorizationConfig.cs │ │ ├── GlobalSecretStorageGrain.cs │ │ ├── Grains.csproj │ │ ├── IGlobalSecretStorageGrain.cs │ │ ├── IUserGrain.cs │ │ └── UserGrain.cs │ ├── IdentityServer │ │ ├── IdentityServer.csproj │ │ ├── IdentityServerConfig.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Quickstart │ │ │ ├── Account │ │ │ │ ├── AccountController.cs │ │ │ │ ├── AccountOptions.cs │ │ │ │ ├── ExternalController.cs │ │ │ │ ├── ExternalProvider.cs │ │ │ │ ├── LoggedOutViewModel.cs │ │ │ │ ├── LoginInputModel.cs │ │ │ │ ├── LoginViewModel.cs │ │ │ │ ├── LogoutInputModel.cs │ │ │ │ ├── LogoutViewModel.cs │ │ │ │ └── RedirectViewModel.cs │ │ │ ├── Consent │ │ │ │ ├── ConsentController.cs │ │ │ │ ├── ConsentInputModel.cs │ │ │ │ ├── ConsentOptions.cs │ │ │ │ ├── ConsentViewModel.cs │ │ │ │ ├── ProcessConsentResult.cs │ │ │ │ └── ScopeViewModel.cs │ │ │ ├── Device │ │ │ │ ├── DeviceAuthorizationInputModel.cs │ │ │ │ ├── DeviceAuthorizationViewModel.cs │ │ │ │ └── DeviceController.cs │ │ │ ├── Diagnostics │ │ │ │ ├── DiagnosticsController.cs │ │ │ │ └── DiagnosticsViewModel.cs │ │ │ ├── Extensions.cs │ │ │ ├── Grants │ │ │ │ ├── GrantsController.cs │ │ │ │ └── GrantsViewModel.cs │ │ │ ├── Home │ │ │ │ ├── ErrorViewModel.cs │ │ │ │ └── HomeController.cs │ │ │ ├── SecurityHeadersAttribute.cs │ │ │ └── TestUsers.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Account │ │ │ │ ├── AccessDenied.cshtml │ │ │ │ ├── LoggedOut.cshtml │ │ │ │ ├── Login.cshtml │ │ │ │ └── Logout.cshtml │ │ │ ├── Consent │ │ │ │ └── Index.cshtml │ │ │ ├── Device │ │ │ │ ├── Success.cshtml │ │ │ │ ├── UserCodeCapture.cshtml │ │ │ │ └── UserCodeConfirmation.cshtml │ │ │ ├── Diagnostics │ │ │ │ └── Index.cshtml │ │ │ ├── Grants │ │ │ │ └── Index.cshtml │ │ │ ├── Home │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── Redirect.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ ├── _Nav.cshtml │ │ │ │ ├── _ScopeListItem.cshtml │ │ │ │ └── _ValidationSummary.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── tempkey.jwk │ │ ├── tempkey.rsa │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ ├── site.less │ │ │ ├── site.min.css │ │ │ └── site.scss │ │ │ ├── favicon.ico │ │ │ ├── icon.jpg │ │ │ ├── icon.png │ │ │ ├── js │ │ │ ├── signin-redirect.js │ │ │ └── signout-redirect.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ └── bootstrap.min.css │ │ │ ├── dist │ │ │ │ ├── css │ │ │ │ │ ├── bootstrap-grid.css │ │ │ │ │ ├── bootstrap-grid.css.map │ │ │ │ │ ├── bootstrap-grid.min.css │ │ │ │ │ ├── bootstrap-grid.min.css.map │ │ │ │ │ ├── bootstrap-reboot.css │ │ │ │ │ ├── bootstrap-reboot.css.map │ │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ │ │ ├── bootstrap.css │ │ │ │ │ ├── bootstrap.css.map │ │ │ │ │ ├── bootstrap.min.css │ │ │ │ │ └── bootstrap.min.css.map │ │ │ │ └── js │ │ │ │ │ ├── bootstrap.bundle.js │ │ │ │ │ ├── bootstrap.bundle.js.map │ │ │ │ │ ├── bootstrap.bundle.min.js │ │ │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ │ │ ├── bootstrap.js │ │ │ │ │ ├── bootstrap.js.map │ │ │ │ │ ├── bootstrap.min.js │ │ │ │ │ └── bootstrap.min.js.map │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ ├── js │ │ │ │ ├── bootstrap.js │ │ │ │ └── bootstrap.min.js │ │ │ └── scss │ │ │ │ ├── _alert.scss │ │ │ │ ├── _badge.scss │ │ │ │ ├── _breadcrumb.scss │ │ │ │ ├── _button-group.scss │ │ │ │ ├── _buttons.scss │ │ │ │ ├── _card.scss │ │ │ │ ├── _carousel.scss │ │ │ │ ├── _close.scss │ │ │ │ ├── _code.scss │ │ │ │ ├── _custom-forms.scss │ │ │ │ ├── _dropdown.scss │ │ │ │ ├── _forms.scss │ │ │ │ ├── _functions.scss │ │ │ │ ├── _grid.scss │ │ │ │ ├── _images.scss │ │ │ │ ├── _input-group.scss │ │ │ │ ├── _jumbotron.scss │ │ │ │ ├── _list-group.scss │ │ │ │ ├── _media.scss │ │ │ │ ├── _mixins.scss │ │ │ │ ├── _modal.scss │ │ │ │ ├── _nav.scss │ │ │ │ ├── _navbar.scss │ │ │ │ ├── _pagination.scss │ │ │ │ ├── _popover.scss │ │ │ │ ├── _print.scss │ │ │ │ ├── _progress.scss │ │ │ │ ├── _reboot.scss │ │ │ │ ├── _root.scss │ │ │ │ ├── _spinners.scss │ │ │ │ ├── _tables.scss │ │ │ │ ├── _toasts.scss │ │ │ │ ├── _tooltip.scss │ │ │ │ ├── _transitions.scss │ │ │ │ ├── _type.scss │ │ │ │ ├── _utilities.scss │ │ │ │ ├── _variables.scss │ │ │ │ ├── bootstrap-grid.scss │ │ │ │ ├── bootstrap-reboot.scss │ │ │ │ ├── bootstrap.scss │ │ │ │ ├── mixins │ │ │ │ ├── _alert.scss │ │ │ │ ├── _background-variant.scss │ │ │ │ ├── _badge.scss │ │ │ │ ├── _border-radius.scss │ │ │ │ ├── _box-shadow.scss │ │ │ │ ├── _breakpoints.scss │ │ │ │ ├── _buttons.scss │ │ │ │ ├── _caret.scss │ │ │ │ ├── _clearfix.scss │ │ │ │ ├── _deprecate.scss │ │ │ │ ├── _float.scss │ │ │ │ ├── _forms.scss │ │ │ │ ├── _gradients.scss │ │ │ │ ├── _grid-framework.scss │ │ │ │ ├── _grid.scss │ │ │ │ ├── _hover.scss │ │ │ │ ├── _image.scss │ │ │ │ ├── _list-group.scss │ │ │ │ ├── _lists.scss │ │ │ │ ├── _nav-divider.scss │ │ │ │ ├── _pagination.scss │ │ │ │ ├── _reset-text.scss │ │ │ │ ├── _resize.scss │ │ │ │ ├── _screen-reader.scss │ │ │ │ ├── _size.scss │ │ │ │ ├── _table-row.scss │ │ │ │ ├── _text-emphasis.scss │ │ │ │ ├── _text-hide.scss │ │ │ │ ├── _text-truncate.scss │ │ │ │ ├── _transition.scss │ │ │ │ └── _visibility.scss │ │ │ │ ├── utilities │ │ │ │ ├── _align.scss │ │ │ │ ├── _background.scss │ │ │ │ ├── _borders.scss │ │ │ │ ├── _clearfix.scss │ │ │ │ ├── _display.scss │ │ │ │ ├── _embed.scss │ │ │ │ ├── _flex.scss │ │ │ │ ├── _float.scss │ │ │ │ ├── _overflow.scss │ │ │ │ ├── _position.scss │ │ │ │ ├── _screenreaders.scss │ │ │ │ ├── _shadows.scss │ │ │ │ ├── _sizing.scss │ │ │ │ ├── _spacing.scss │ │ │ │ ├── _stretched-link.scss │ │ │ │ ├── _text.scss │ │ │ │ └── _visibility.scss │ │ │ │ └── vendor │ │ │ │ └── _rfs.scss │ │ │ └── jquery │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── dist │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ ├── jquery.min.map │ │ │ ├── jquery.slim.js │ │ │ ├── jquery.slim.min.js │ │ │ └── jquery.slim.min.map │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ └── WebClient │ │ ├── Controllers │ │ └── HomeController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── UserProfile.cshtml │ │ └── _ViewImports.cshtml │ │ ├── WebClient.csproj │ │ ├── appsettings.Development.json │ │ └── appsettings.json ├── dotnet-5 │ ├── Api │ │ ├── Api.csproj │ │ ├── Controllers │ │ │ └── UserController.cs │ │ ├── Orleans │ │ │ ├── AspNetCoreAccessTokenProvider.cs │ │ │ └── OrleansClusterClientProvider.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── ConsoleClient │ │ ├── ConsoleClient.csproj │ │ └── Program.cs │ ├── Grains │ │ ├── GlobalSecretStorageGrain.cs │ │ ├── Grains.csproj │ │ └── UserGrain.cs │ ├── GrainsInterfaces │ │ ├── AuthorizationConfig.cs │ │ ├── GrainsInterfaces.csproj │ │ ├── IGlobalSecretStorageGrain.cs │ │ └── IUserGrain.cs │ ├── IdentityServer │ │ ├── IdentityServer.csproj │ │ ├── IdentityServerConfig.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Quickstart │ │ │ ├── Account │ │ │ │ ├── AccountController.cs │ │ │ │ ├── AccountOptions.cs │ │ │ │ ├── ExternalController.cs │ │ │ │ ├── ExternalProvider.cs │ │ │ │ ├── LoggedOutViewModel.cs │ │ │ │ ├── LoginInputModel.cs │ │ │ │ ├── LoginViewModel.cs │ │ │ │ ├── LogoutInputModel.cs │ │ │ │ ├── LogoutViewModel.cs │ │ │ │ └── RedirectViewModel.cs │ │ │ ├── Consent │ │ │ │ ├── ConsentController.cs │ │ │ │ ├── ConsentInputModel.cs │ │ │ │ ├── ConsentOptions.cs │ │ │ │ ├── ConsentViewModel.cs │ │ │ │ ├── ProcessConsentResult.cs │ │ │ │ └── ScopeViewModel.cs │ │ │ ├── Device │ │ │ │ ├── DeviceAuthorizationInputModel.cs │ │ │ │ ├── DeviceAuthorizationViewModel.cs │ │ │ │ └── DeviceController.cs │ │ │ ├── Diagnostics │ │ │ │ ├── DiagnosticsController.cs │ │ │ │ └── DiagnosticsViewModel.cs │ │ │ ├── Extensions.cs │ │ │ ├── Grants │ │ │ │ ├── GrantsController.cs │ │ │ │ └── GrantsViewModel.cs │ │ │ ├── Home │ │ │ │ ├── ErrorViewModel.cs │ │ │ │ └── HomeController.cs │ │ │ ├── SecurityHeadersAttribute.cs │ │ │ └── TestUsers.cs │ │ ├── Startup.cs │ │ ├── Views │ │ │ ├── Account │ │ │ │ ├── AccessDenied.cshtml │ │ │ │ ├── LoggedOut.cshtml │ │ │ │ ├── Login.cshtml │ │ │ │ └── Logout.cshtml │ │ │ ├── Consent │ │ │ │ └── Index.cshtml │ │ │ ├── Device │ │ │ │ ├── Success.cshtml │ │ │ │ ├── UserCodeCapture.cshtml │ │ │ │ └── UserCodeConfirmation.cshtml │ │ │ ├── Diagnostics │ │ │ │ └── Index.cshtml │ │ │ ├── Grants │ │ │ │ └── Index.cshtml │ │ │ ├── Home │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── Redirect.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ ├── _Nav.cshtml │ │ │ │ ├── _ScopeListItem.cshtml │ │ │ │ └── _ValidationSummary.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── tempkey.jwk │ │ ├── tempkey.rsa │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ ├── site.less │ │ │ ├── site.min.css │ │ │ └── site.scss │ │ │ ├── favicon.ico │ │ │ ├── icon.jpg │ │ │ ├── icon.png │ │ │ ├── js │ │ │ ├── signin-redirect.js │ │ │ └── signout-redirect.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ └── bootstrap.min.css │ │ │ ├── dist │ │ │ │ ├── css │ │ │ │ │ ├── bootstrap-grid.css │ │ │ │ │ ├── bootstrap-grid.css.map │ │ │ │ │ ├── bootstrap-grid.min.css │ │ │ │ │ ├── bootstrap-grid.min.css.map │ │ │ │ │ ├── bootstrap-reboot.css │ │ │ │ │ ├── bootstrap-reboot.css.map │ │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ │ │ ├── bootstrap.css │ │ │ │ │ ├── bootstrap.css.map │ │ │ │ │ ├── bootstrap.min.css │ │ │ │ │ └── bootstrap.min.css.map │ │ │ │ └── js │ │ │ │ │ ├── bootstrap.bundle.js │ │ │ │ │ ├── bootstrap.bundle.js.map │ │ │ │ │ ├── bootstrap.bundle.min.js │ │ │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ │ │ ├── bootstrap.js │ │ │ │ │ ├── bootstrap.js.map │ │ │ │ │ ├── bootstrap.min.js │ │ │ │ │ └── bootstrap.min.js.map │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ ├── js │ │ │ │ ├── bootstrap.js │ │ │ │ └── bootstrap.min.js │ │ │ └── scss │ │ │ │ ├── _alert.scss │ │ │ │ ├── _badge.scss │ │ │ │ ├── _breadcrumb.scss │ │ │ │ ├── _button-group.scss │ │ │ │ ├── _buttons.scss │ │ │ │ ├── _card.scss │ │ │ │ ├── _carousel.scss │ │ │ │ ├── _close.scss │ │ │ │ ├── _code.scss │ │ │ │ ├── _custom-forms.scss │ │ │ │ ├── _dropdown.scss │ │ │ │ ├── _forms.scss │ │ │ │ ├── _functions.scss │ │ │ │ ├── _grid.scss │ │ │ │ ├── _images.scss │ │ │ │ ├── _input-group.scss │ │ │ │ ├── _jumbotron.scss │ │ │ │ ├── _list-group.scss │ │ │ │ ├── _media.scss │ │ │ │ ├── _mixins.scss │ │ │ │ ├── _modal.scss │ │ │ │ ├── _nav.scss │ │ │ │ ├── _navbar.scss │ │ │ │ ├── _pagination.scss │ │ │ │ ├── _popover.scss │ │ │ │ ├── _print.scss │ │ │ │ ├── _progress.scss │ │ │ │ ├── _reboot.scss │ │ │ │ ├── _root.scss │ │ │ │ ├── _spinners.scss │ │ │ │ ├── _tables.scss │ │ │ │ ├── _toasts.scss │ │ │ │ ├── _tooltip.scss │ │ │ │ ├── _transitions.scss │ │ │ │ ├── _type.scss │ │ │ │ ├── _utilities.scss │ │ │ │ ├── _variables.scss │ │ │ │ ├── bootstrap-grid.scss │ │ │ │ ├── bootstrap-reboot.scss │ │ │ │ ├── bootstrap.scss │ │ │ │ ├── mixins │ │ │ │ ├── _alert.scss │ │ │ │ ├── _background-variant.scss │ │ │ │ ├── _badge.scss │ │ │ │ ├── _border-radius.scss │ │ │ │ ├── _box-shadow.scss │ │ │ │ ├── _breakpoints.scss │ │ │ │ ├── _buttons.scss │ │ │ │ ├── _caret.scss │ │ │ │ ├── _clearfix.scss │ │ │ │ ├── _deprecate.scss │ │ │ │ ├── _float.scss │ │ │ │ ├── _forms.scss │ │ │ │ ├── _gradients.scss │ │ │ │ ├── _grid-framework.scss │ │ │ │ ├── _grid.scss │ │ │ │ ├── _hover.scss │ │ │ │ ├── _image.scss │ │ │ │ ├── _list-group.scss │ │ │ │ ├── _lists.scss │ │ │ │ ├── _nav-divider.scss │ │ │ │ ├── _pagination.scss │ │ │ │ ├── _reset-text.scss │ │ │ │ ├── _resize.scss │ │ │ │ ├── _screen-reader.scss │ │ │ │ ├── _size.scss │ │ │ │ ├── _table-row.scss │ │ │ │ ├── _text-emphasis.scss │ │ │ │ ├── _text-hide.scss │ │ │ │ ├── _text-truncate.scss │ │ │ │ ├── _transition.scss │ │ │ │ └── _visibility.scss │ │ │ │ ├── utilities │ │ │ │ ├── _align.scss │ │ │ │ ├── _background.scss │ │ │ │ ├── _borders.scss │ │ │ │ ├── _clearfix.scss │ │ │ │ ├── _display.scss │ │ │ │ ├── _embed.scss │ │ │ │ ├── _flex.scss │ │ │ │ ├── _float.scss │ │ │ │ ├── _overflow.scss │ │ │ │ ├── _position.scss │ │ │ │ ├── _screenreaders.scss │ │ │ │ ├── _shadows.scss │ │ │ │ ├── _sizing.scss │ │ │ │ ├── _spacing.scss │ │ │ │ ├── _stretched-link.scss │ │ │ │ ├── _text.scss │ │ │ │ └── _visibility.scss │ │ │ │ └── vendor │ │ │ │ └── _rfs.scss │ │ │ └── jquery │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── dist │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ ├── jquery.min.map │ │ │ ├── jquery.slim.js │ │ │ ├── jquery.slim.min.js │ │ │ └── jquery.slim.min.map │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ ├── SiloHost1 │ │ ├── Program.cs │ │ └── SiloHost1.csproj │ └── WebClient │ │ ├── Controllers │ │ └── HomeController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── UserProfile.cshtml │ │ └── _ViewImports.cshtml │ │ ├── WebClient.csproj │ │ ├── appsettings.Development.json │ │ └── appsettings.json └── dotnetcore-3-1 │ ├── Api │ ├── Api.csproj │ ├── Controllers │ │ └── UserController.cs │ ├── Orleans │ │ ├── AspNetCoreAccessTokenProvider.cs │ │ └── OrleansClusterClientProvider.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── ConsoleClient │ ├── ConsoleClient.csproj │ └── Program.cs │ ├── Grains │ ├── GlobalSecretStorageGrain.cs │ ├── Grains.csproj │ └── UserGrain.cs │ ├── GrainsInterfaces │ ├── AuthorizationConfig.cs │ ├── GrainsInterfaces.csproj │ ├── IGlobalSecretStorageGrain.cs │ └── IUserGrain.cs │ ├── IdentityServer │ ├── IdentityServer.csproj │ ├── IdentityServerConfig.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Quickstart │ │ ├── Account │ │ │ ├── AccountController.cs │ │ │ ├── AccountOptions.cs │ │ │ ├── ExternalController.cs │ │ │ ├── ExternalProvider.cs │ │ │ ├── LoggedOutViewModel.cs │ │ │ ├── LoginInputModel.cs │ │ │ ├── LoginViewModel.cs │ │ │ ├── LogoutInputModel.cs │ │ │ ├── LogoutViewModel.cs │ │ │ └── RedirectViewModel.cs │ │ ├── Consent │ │ │ ├── ConsentController.cs │ │ │ ├── ConsentInputModel.cs │ │ │ ├── ConsentOptions.cs │ │ │ ├── ConsentViewModel.cs │ │ │ ├── ProcessConsentResult.cs │ │ │ └── ScopeViewModel.cs │ │ ├── Device │ │ │ ├── DeviceAuthorizationInputModel.cs │ │ │ ├── DeviceAuthorizationViewModel.cs │ │ │ └── DeviceController.cs │ │ ├── Diagnostics │ │ │ ├── DiagnosticsController.cs │ │ │ └── DiagnosticsViewModel.cs │ │ ├── Extensions.cs │ │ ├── Grants │ │ │ ├── GrantsController.cs │ │ │ └── GrantsViewModel.cs │ │ ├── Home │ │ │ ├── ErrorViewModel.cs │ │ │ └── HomeController.cs │ │ ├── SecurityHeadersAttribute.cs │ │ └── TestUsers.cs │ ├── Startup.cs │ ├── Views │ │ ├── Account │ │ │ ├── AccessDenied.cshtml │ │ │ ├── LoggedOut.cshtml │ │ │ ├── Login.cshtml │ │ │ └── Logout.cshtml │ │ ├── Consent │ │ │ └── Index.cshtml │ │ ├── Device │ │ │ ├── Success.cshtml │ │ │ ├── UserCodeCapture.cshtml │ │ │ └── UserCodeConfirmation.cshtml │ │ ├── Diagnostics │ │ │ └── Index.cshtml │ │ ├── Grants │ │ │ └── Index.cshtml │ │ ├── Home │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── Redirect.cshtml │ │ │ ├── _Layout.cshtml │ │ │ ├── _ScopeListItem.cshtml │ │ │ └── _ValidationSummary.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── tempkey.rsa │ └── wwwroot │ │ ├── css │ │ ├── site.css │ │ ├── site.less │ │ └── site.min.css │ │ ├── favicon.ico │ │ ├── icon.jpg │ │ ├── icon.png │ │ ├── js │ │ ├── signin-redirect.js │ │ └── signout-redirect.js │ │ └── lib │ │ ├── bootstrap │ │ ├── css │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ └── bootstrap.min.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ │ ├── bootstrap.js │ │ │ └── bootstrap.min.js │ │ └── jquery │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map │ ├── SiloHost1 │ ├── Program.cs │ └── SiloHost1.csproj │ └── WebClient │ ├── Controllers │ └── HomeController.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ └── UserProfile.cshtml │ └── _ViewImports.cshtml │ ├── WebClient.csproj │ ├── appsettings.Development.json │ └── appsettings.json ├── src ├── Directory.Build.props ├── Orleans.Security.Authorization │ ├── AllowAnonymousAttribute.cs │ ├── AssertionRequirement.cs │ ├── AuthorizationFailure.cs │ ├── AuthorizationHandler.cs │ ├── AuthorizationHandlerContext.cs │ ├── AuthorizationOptions.cs │ ├── AuthorizationPolicy.cs │ ├── AuthorizationPolicyBuilder.cs │ ├── AuthorizationResult.cs │ ├── AuthorizationServiceCollectionExtensions.cs │ ├── AuthorizationServiceExtensions.cs │ ├── AuthorizeAttribute.cs │ ├── ClaimsAuthorizationRequirement.cs │ ├── DefaultAuthorizationEvaluator.cs │ ├── DefaultAuthorizationHandlerContextFactory.cs │ ├── DefaultAuthorizationHandlerProvider.cs │ ├── DefaultAuthorizationPolicyProvider.cs │ ├── DefaultAuthorizationService.cs │ ├── DenyAnonymousAuthorizationRequirement.cs │ ├── IAllowAnonymous.cs │ ├── IAuthorizationEvaluator.cs │ ├── IAuthorizationHandler.cs │ ├── IAuthorizationHandlerContextFactory.cs │ ├── IAuthorizationHandlerProvider.cs │ ├── IAuthorizationPolicyProvider.cs │ ├── IAuthorizationRequirement.cs │ ├── IAuthorizationService.cs │ ├── IAuthorizeData.cs │ ├── LoggingExtensions.cs │ ├── NameAuthorizationRequirement.cs │ ├── OperationAuthorizationRequirement.cs │ ├── Orleans.Security.Authorization.csproj │ ├── PassThroughAuthorizationHandler.cs │ ├── Properties │ │ └── Resources.Designer.cs │ ├── Resources.resx │ └── RolesAuthorizationRequirement.cs ├── Orleans.Security.Client │ ├── AssemblyInfo.cs │ ├── AuthorizationServiceCollectionExtensions.cs │ └── Orleans.Security.Client.csproj ├── Orleans.Security.Clustering │ ├── AssemblyInfo.cs │ ├── AuthorizationServiceCollectionExtensions.cs │ └── Orleans.Security.Clustering.csproj ├── Orleans.Security.Interoperability │ ├── AssemblyInfo.cs │ ├── Authorization │ │ ├── GrainAuthorizationFilterBase.cs │ │ ├── IncomingGrainCallAuthorizationFilter.cs │ │ └── OutgoingGrainCallAuthorizationFilter.cs │ ├── GrainWithClaimsPrincipal.cs │ ├── Orleans.Security.Interoperability.csproj │ ├── RuntimeMethodBinder.cs │ └── ServiceCollectionExtensions.cs └── Orleans.Security │ ├── AccessToken │ ├── AccessTokenAnalyzer.fs │ ├── AccessTokenIntrospectionResult.fs │ ├── AccessTokenIntrospectionServiceDefault.fs │ ├── AccessTokenType.fs │ ├── AccessTokenVerificationResult.fs │ ├── AccessTokenVerifierOptions.fs │ ├── AccessTokenVerifierWithCaching.fs │ ├── AccessTokenVerifierWithTracing.fs │ ├── DefaultAccessTokenVerifier.fs │ ├── IAccessTokenIntrospectionService.fs │ ├── IAccessTokenVerifier.fs │ ├── IdS4DiscoveryDocumentProvider.fs │ ├── InvalidAccessTokenException.fs │ └── JwtSecurityTokenVerifier.fs │ ├── AccessTokenSetterFilter.fs │ ├── AssemblyInfo.fs │ ├── Authorization │ ├── AuthorizationAdmission.fs │ ├── AuthorizationExecutor.fs │ └── IAuthorizationExecutor.fs │ ├── Caching │ ├── AccessTokenCache.fs │ └── IAccessTokenCache.fs │ ├── Configuration.fs │ ├── ConfigurationKeys.fs │ ├── DiscoveryDocumentShortInfo.fs │ ├── Extensions.fs │ ├── GlobalSettings.fs │ ├── GrainWithClaimsPrincipal.fs │ ├── IAccessTokenProvider.fs │ ├── IdentityServer4Info.fs │ ├── LoggingEvents.fs │ ├── NotAuthorizedException.fs │ ├── Orleans.Security.fsproj │ └── ServiceCollectionExtensions.fs └── test ├── Orleans.Security.IntegrationTests.Functional ├── AccessTokenTests │ └── AccessTokenVerificationTests.fs ├── Assembly.fs ├── AuthorizationTests │ ├── ClaimsBasedAuthorizationTests.fs │ ├── PolicyBasedAuthorizationTests.fs │ ├── ResourceBasedAuthorizationTests.fs │ ├── RoleBasedAuthorizationTests.fs │ └── SimpleAuthorizationTests.fs ├── Initialization │ ├── ClusterSetup.fs │ ├── GlobalConfig.fs │ ├── IdSClients.fs │ ├── IdSInstance.fs │ ├── IdSResources.fs │ ├── IdSTokenFactory.fs │ ├── IdentityServer.fs │ ├── ProfileService.fs │ ├── SiloClient.fs │ ├── SiloHost.fs │ └── Users.fs ├── Orleans.Security.IntegrationTests.FSharp.fsproj ├── Program.fs └── TestsNUnit.fs ├── Orleans.Security.IntegrationTests.Grains ├── AuthorizationConfig.cs ├── ClaimsBasedAuthorization │ ├── CityClaim.cs │ ├── ClaimGrain.cs │ └── IClaimGrain.cs ├── GlobalSecretStorageGrain.cs ├── IGlobalSecretStorageGrain.cs ├── Orleans.Security.IntegrationTests.Grains.csproj ├── PolicyBasedAuthorization │ ├── IPolicyGrain.cs │ └── PolicyGrain.cs ├── ResourceBasedAuthorization │ ├── DocModifyAuthorizationHandler.cs │ ├── DocRegistryAccessClaim.cs │ ├── DocRegistryAccessHandler.cs │ ├── DocRegistryAccessRequirement.cs │ ├── Document.cs │ ├── DocumentsRegistry.cs │ ├── DocumentsRegistryGrain.cs │ ├── IDocumentsRegistryGrain.cs │ ├── IUserGrain.cs │ └── UserGrain.cs ├── RoleBasedAuthorization │ ├── IManagerGrain.cs │ └── ManagerGrain.cs └── SimpleAuthorization │ ├── ISimpleGrain.cs │ └── SimpleGrain.cs ├── Orleans.Security.IntegrationTests.TokenVerification ├── Configuration │ ├── IdentityServerConfig.cs │ ├── TestIdentityServer4Builder.cs │ └── TestUsers.cs ├── Orleans.Security.IntegrationTests.TokenVerification.csproj ├── TestBase.cs └── TokenVerificationTests.cs ├── Orleans.Security.IntegrationTests ├── AuthorizationTests.cs ├── Configuration │ ├── AuthorizationTestConfig.cs │ ├── EmailVerifiedHandler.cs │ ├── EmailVerifiedRequirement.cs │ ├── FakeAccessTokenProvider.cs │ ├── FakeAccessTokenVerifier.cs │ ├── GenderRequirement.cs │ ├── LoggedInUser.cs │ ├── RoleAndGenderCombinationHandler.cs │ ├── RoleIsPresentRequirement.cs │ ├── TestClientBuilder.cs │ ├── TestClusterBuilder.cs │ └── TestClusterOptions.cs ├── GrainsForTests │ ├── AuthorizationTestGrain.cs │ └── IAuthorizationTestGrain.cs ├── Orleans.Security.IntegrationTests.csproj └── SetUpTestEnvieronment.cs └── Orleans.Security.Tests ├── AuthorizationAdmissionTests.cs └── Orleans.Security.Tests.csproj /.editorconfig: -------------------------------------------------------------------------------- 1 | # All files 2 | [*] 3 | guidelines = 80, 120 4 | 5 | # C# or VB files 6 | [*.{cs,vb}] 7 | guidelines = 80, 120 8 | # ARGB color format (red with 25% opacity) 9 | guidelines_style = 2px dotted 40ff0000 10 | 11 | # F# files 12 | [*.{fs}] 13 | guidelines = 80, 120 14 | # ARGB color format (red with 25% opacity) 15 | guidelines_style = 2px dotted 40ff0000 -------------------------------------------------------------------------------- /GitVersion.yml: -------------------------------------------------------------------------------- 1 | mode: ContinuousDelivery 2 | branches: {} 3 | ignore: 4 | sha: [] 5 | merge-message-formats: {} 6 | -------------------------------------------------------------------------------- /Orleans.Security.sln.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True -------------------------------------------------------------------------------- /docs-builder/.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignoreFiles" : [ 3 | "assets/css/just-the-docs.scss", 4 | "assets/css/dark-mode-preview.scss", 5 | "_sass/vendor/**/*.scss" 6 | ], 7 | "extends": [ 8 | "stylelint-config-primer" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /docs-builder/.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - 2.3.0 4 | env: 5 | - TRAVIS_NODE_VERSION="9.3.0" 6 | 7 | install: 8 | - npm install 9 | - gem install bundler --version '>=1.17.1' 10 | - bundle install 11 | 12 | script: 13 | - npm run test 14 | - bundle exec jekyll build 15 | -------------------------------------------------------------------------------- /docs-builder/404.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Page not found 4 | permalink: /404 5 | nav_exclude: true 6 | search_exclude: true 7 | --- 8 | 9 |

Page not found

10 | 11 |

The page you requested could not be found. Try using the navigation {% if site.search_enabled %}or search {% endif %}to find what you're looking for or go to this site's home page.

12 | -------------------------------------------------------------------------------- /docs-builder/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | gemspec 3 | -------------------------------------------------------------------------------- /docs-builder/Index1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs-builder/Index1.jpg -------------------------------------------------------------------------------- /docs-builder/Index2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs-builder/Index2.jpg -------------------------------------------------------------------------------- /docs-builder/Rakefile: -------------------------------------------------------------------------------- 1 | Dir.glob('lib/tasks/*.rake').each {|r| import r} 2 | -------------------------------------------------------------------------------- /docs-builder/_includes/head_custom.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs-builder/_includes/head_custom.html -------------------------------------------------------------------------------- /docs-builder/_includes/js/custom.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs-builder/_includes/js/custom.js -------------------------------------------------------------------------------- /docs-builder/_includes/title.html: -------------------------------------------------------------------------------- 1 | {% if site.logo %} 2 | 3 | {% else %} 4 | {{ site.title }} 5 | {% endif %} 6 | -------------------------------------------------------------------------------- /docs-builder/_layouts/about.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /docs-builder/_layouts/home.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /docs-builder/_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /docs-builder/_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /docs-builder/_layouts/table_wrappers.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: vendor/compress 3 | --- 4 | 5 | {% assign content_ = content | replace: '', '' %} 7 | {{ content_ }} -------------------------------------------------------------------------------- /docs-builder/_sass/color_schemes/dark.scss: -------------------------------------------------------------------------------- 1 | 2 | $body-background-color: $grey-dk-300; 3 | $sidebar-color: $grey-dk-300; 4 | $border-color: $grey-dk-200; 5 | 6 | $body-text-color: $grey-lt-300; 7 | $body-heading-color: $grey-lt-000; 8 | $nav-child-link-color: $grey-dk-000; 9 | $search-result-preview-color: $grey-dk-000; 10 | 11 | $link-color: $blue-000; 12 | $btn-primary-color: $blue-200; 13 | $base-button-color: $grey-dk-250; 14 | 15 | $code-background-color: $grey-dk-250; 16 | $search-background-color: $grey-dk-250; 17 | $table-background-color: $grey-dk-250; 18 | -------------------------------------------------------------------------------- /docs-builder/_sass/labels.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Labels (not the form kind) 3 | // 4 | 5 | .label, 6 | .label-blue { 7 | display: inline-block; 8 | padding-top: 0.16em; 9 | padding-right: 0.42em; 10 | padding-bottom: 0.16em; 11 | padding-left: 0.42em; 12 | margin-right: $sp-1; 13 | margin-left: $sp-1; 14 | color: $white; 15 | text-transform: uppercase; 16 | vertical-align: middle; 17 | background-color: $blue-100; 18 | @include fs-2; 19 | } 20 | 21 | .label-green { 22 | background-color: $green-200; 23 | } 24 | 25 | .label-purple { 26 | background-color: $purple-100; 27 | } 28 | 29 | .label-red { 30 | background-color: $red-200; 31 | } 32 | 33 | .label-yellow { 34 | color: $grey-dk-200; 35 | background-color: $yellow-200; 36 | } 37 | -------------------------------------------------------------------------------- /docs-builder/_sass/overrides.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Custom overrides from a user. 3 | // 4 | -------------------------------------------------------------------------------- /docs-builder/_sass/support/_functions.scss: -------------------------------------------------------------------------------- 1 | @function rem($size, $unit:"") { 2 | $remSize: $size / $root-font-size; 3 | 4 | @if ($unit == false) { 5 | @return #{$remSize}; 6 | } 7 | @else { 8 | @return #{$remSize}rem; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs-builder/_sass/support/mixins/_buttons.scss: -------------------------------------------------------------------------------- 1 | // Colored button 2 | 3 | @mixin btn-color($fg, $bg) { 4 | color: $fg; 5 | background-color: darken($bg, 2%); 6 | background-image: linear-gradient(lighten($bg, 5%), darken($bg, 2%)); 7 | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.12); 8 | 9 | &:hover, 10 | &.zeroclipboard-is-hover { 11 | color: $fg; 12 | background-color: darken($bg, 4%); 13 | background-image: linear-gradient((lighten($bg, 2%), darken($bg, 4%))); 14 | } 15 | 16 | &:active, 17 | &.selected, 18 | &.zeroclipboard-is-active { 19 | background-color: darken($bg, 5%); 20 | background-image: none; 21 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15); 22 | } 23 | 24 | &.selected:hover { 25 | background-color: darken($bg, 10%); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /docs-builder/_sass/support/mixins/_layout.scss: -------------------------------------------------------------------------------- 1 | // Media query 2 | 3 | // Media query mixin 4 | // Usage: 5 | // @include mq(md) { 6 | // ..medium and up styles 7 | // } 8 | @mixin mq($name) { 9 | // Retrieves the value from the key 10 | $value: map-get($media-queries, $name); 11 | 12 | // If the key exists in the map 13 | @if $value != null { 14 | // Prints a media query based on the value 15 | @media (min-width: rem($value)) { 16 | @content; 17 | } 18 | } 19 | 20 | @else { 21 | @warn "No value could be retrieved from `#{$media-query}`. " 22 | + "Please make sure it is defined in `$media-queries` map."; 23 | } 24 | } 25 | 26 | // Responsive container 27 | 28 | @mixin container { 29 | padding-right: $gutter-spacing-sm; 30 | padding-left: $gutter-spacing-sm; 31 | 32 | @include mq(md) { 33 | padding-right: $gutter-spacing; 34 | padding-left: $gutter-spacing; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /docs-builder/_sass/support/mixins/mixins.scss: -------------------------------------------------------------------------------- 1 | @import "./layout"; 2 | @import "./buttons"; 3 | @import "./typography"; 4 | -------------------------------------------------------------------------------- /docs-builder/_sass/support/support.scss: -------------------------------------------------------------------------------- 1 | @import "./variables"; 2 | @import "./functions"; 3 | @import "./mixins/mixins"; 4 | -------------------------------------------------------------------------------- /docs-builder/_sass/typography.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Typography 3 | // 4 | // stylelint-disable primer/selector-no-utility, primer/no-override, selector-no-type, selector-max-type 5 | 6 | h1, 7 | .text-alpha { 8 | @include fs-8; 9 | font-weight: 300; 10 | } 11 | 12 | h2, 13 | .text-beta { 14 | @include fs-6; 15 | } 16 | 17 | h3, 18 | .text-gamma { 19 | @include fs-5; 20 | } 21 | 22 | h4, 23 | .text-delta { 24 | @include fs-2; 25 | font-weight: 300; 26 | text-transform: uppercase; 27 | letter-spacing: 0.1em; 28 | } 29 | 30 | h5, 31 | .text-epsilon { 32 | @include fs-3; 33 | color: $grey-dk-200; 34 | } 35 | 36 | h6, 37 | .text-zeta { 38 | @include fs-2; 39 | color: $grey-dk-200; 40 | } 41 | 42 | li { 43 | .highlight { 44 | margin-top: $sp-2; 45 | } 46 | } 47 | 48 | .text-small { 49 | @include fs-2; 50 | } 51 | 52 | .text-mono { 53 | font-family: $mono-font-family !important; 54 | } 55 | 56 | .text-center { 57 | text-align: center !important; 58 | } 59 | -------------------------------------------------------------------------------- /docs-builder/_sass/utilities/_lists.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes for lists 3 | // 4 | 5 | // stylelint-disable primer/selector-no-utility, primer/no-override, selector-max-type 6 | 7 | .list-style-none { 8 | padding: 0 !important; 9 | margin: 0 !important; 10 | list-style: none !important; 11 | 12 | li { 13 | &::before { 14 | display: none !important; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /docs-builder/_sass/utilities/utilities.scss: -------------------------------------------------------------------------------- 1 | @import "./colors"; 2 | @import "./layout"; 3 | @import "./typography"; 4 | @import "./lists"; 5 | @import "./spacing"; 6 | -------------------------------------------------------------------------------- /docs-builder/assets/css/dark-mode-preview.scss: -------------------------------------------------------------------------------- 1 | --- 2 | # this ensures Jekyll reads the file to be transformed into CSS later 3 | # only Main files contain this front matter, not partials. 4 | --- 5 | 6 | {% if site.logo %} 7 | $logo: "{{ site.logo | absolute_url }}"; 8 | {% endif %} 9 | 10 | // 11 | // Import external dependencies 12 | // 13 | 14 | @import "./vendor/normalize.scss/normalize.scss"; 15 | 16 | // 17 | // Import Just the Docs scss 18 | // 19 | 20 | // Support 21 | @import "./support/support"; 22 | 23 | // 24 | // Import custom color scheme scss 25 | // 26 | 27 | @import "./color_schemes/dark.scss"; 28 | 29 | // Modules 30 | @import "./base"; 31 | @import "./layout"; 32 | @import "./content"; 33 | @import "./navigation"; 34 | @import "./typography"; 35 | @import "./labels"; 36 | @import "./buttons"; 37 | @import "./search"; 38 | @import "./tables"; 39 | @import "./code"; 40 | @import "./utilities/utilities"; 41 | 42 | // 43 | // Import custom overrides 44 | // 45 | @import "./custom/custom"; 46 | -------------------------------------------------------------------------------- /docs-builder/assets/images/just-the-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs-builder/assets/images/just-the-docs.png -------------------------------------------------------------------------------- /docs-builder/assets/images/search.svg: -------------------------------------------------------------------------------- 1 | Search 2 | -------------------------------------------------------------------------------- /docs-builder/assets/js/search-data.json: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | { 4 | {% assign comma = false %} 5 | {% for page in site.html_pages %}{% if page.search_exclude != true %}{% if comma == true%},{% endif %}"{{ forloop.index0 }}": { 6 | "title": "{{ page.title | replace: '&', '&' }}", 7 | "content": "{{ page.content | markdownify | replace: ' 3.8.5" 17 | spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.0" 18 | spec.add_runtime_dependency "rake", "~> 12.3.1" 19 | 20 | spec.add_development_dependency "bundler", "~> 2.0.1" 21 | end 22 | -------------------------------------------------------------------------------- /docs-builder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "just-the-docs", 3 | "version": "0.2.7", 4 | "description": "A modern Jekyll theme for documentation", 5 | "repository": "pmarsceill/just-the-docs", 6 | "license": "MIT", 7 | "bugs": "https://github.com/pmarsceill/just-the-docs/issues", 8 | "devDependencies": { 9 | "stylelint": "^10.0.1", 10 | "stylelint-config-primer": "^8.0.0", 11 | "stylelint-selector-no-utility": "^4.0.0" 12 | }, 13 | "dependencies": { 14 | "@primer/css": "^12.7.0" 15 | }, 16 | "scripts": { 17 | "test": "stylelint '**/*.scss'" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs-builder/resources/Drawing1.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs-builder/resources/Drawing1.vsdx -------------------------------------------------------------------------------- /docs-builder/resources/Drawing2.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs-builder/resources/Drawing2.vsdx -------------------------------------------------------------------------------- /docs-builder/script/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Packaging gem... \n" 4 | gem build just-the-docs.gemspec 5 | 6 | echo "Cleaning up... \n" 7 | git add *.gem 8 | git commit -m 'Bump just-the-docs gem package' 9 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | orlsec.asynchub.org -------------------------------------------------------------------------------- /docs/Index1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs/Index1.jpg -------------------------------------------------------------------------------- /docs/Index2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs/Index2.jpg -------------------------------------------------------------------------------- /docs/assets/images/just-the-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs/assets/images/just-the-docs.png -------------------------------------------------------------------------------- /docs/assets/images/search.svg: -------------------------------------------------------------------------------- 1 | Search 2 | -------------------------------------------------------------------------------- /docs/resources/Drawing1.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs/resources/Drawing1.vsdx -------------------------------------------------------------------------------- /docs/resources/Drawing2.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/docs/resources/Drawing2.vsdx -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/ApiAndSiloHost/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:35001", 7 | "sslPort": 44371 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "ApiAndSiloHost": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:5002;https://localhost:5003" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/ApiAndSiloHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Trace", 5 | "Orleans.Runtime": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/ApiAndSiloHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Trace", 5 | "Orleans.Runtime": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/Grains/AuthorizationConfig.cs: -------------------------------------------------------------------------------- 1 | using Orleans.Security.Authorization; 2 | 3 | namespace Grains 4 | { 5 | public static class AuthorizationConfig 6 | { 7 | public static void ConfigureOptions(AuthorizationOptions options) 8 | { 9 | options.AddPolicy("AdminPolicy", policy => policy.RequireRole("Admin")); 10 | options.AddPolicy("ManagerPolicy", policy => policy.RequireRole("Manager")); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/Grains/Grains.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | all 10 | runtime; build; native; contentfiles; analyzers 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/Grains/IGlobalSecretStorageGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans; 3 | using Orleans.Security.Authorization; 4 | 5 | namespace Grains 6 | { 7 | public interface IGlobalSecretStorageGrain : IGrainWithStringKey 8 | { 9 | [Authorize(Roles = "Admin")] 10 | Task TakeUserSecret(string userId); 11 | } 12 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/Grains/IUserGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans; 3 | using Orleans.Security.Authorization; 4 | 5 | namespace Grains 6 | { 7 | public interface IUserGrain : IGrainWithStringKey 8 | { 9 | [Authorize(Policy = "ManagerPolicy")] 10 | Task TakeSecret(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/IdentityServer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | IdentityServer4 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using IdentityServer4; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Configuration; 8 | using Microsoft.Extensions.Hosting; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace IdentityServer4 12 | { 13 | internal static class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateHostBuilder(args).Build().Run(); 18 | } 19 | 20 | private static IHostBuilder CreateHostBuilder(string[] args) => 21 | Host.CreateDefaultBuilder(args) 22 | .ConfigureWebHostDefaults(webBuilder => 23 | { 24 | webBuilder.UseStartup(); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:7600", 7 | "sslPort": 44396 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "IdentityServer": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:5000;https://localhost:5001" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/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 IdentityServerHost.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 | public static string InvalidCredentialsErrorMessage = "Invalid username or password"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/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 IdentityServerHost.Quickstart.UI 6 | { 7 | public class LoggedOutViewModel 8 | { 9 | public string PostLogoutRedirectUri { get; set; } 10 | public string ClientName { get; set; } 11 | public string SignOutIframeUrl { get; set; } 12 | 13 | public bool AutomaticRedirectAfterSignOut { get; set; } 14 | 15 | public string LogoutId { get; set; } 16 | public bool TriggerExternalSignout => ExternalAuthenticationScheme != null; 17 | public string ExternalAuthenticationScheme { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServerHost.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 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Account/RedirectViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | 6 | namespace IdentityServerHost.Quickstart.UI 7 | { 8 | public class RedirectViewModel 9 | { 10 | public string RedirectUrl { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServerHost.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 | public string Description { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/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 IdentityServerHost.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 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/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 IdentityServerHost.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 ApiScopes { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServerHost.Quickstart.UI 8 | { 9 | public class ProcessConsentResult 10 | { 11 | public bool IsRedirect => RedirectUri != null; 12 | public string RedirectUri { get; set; } 13 | public Client Client { get; set; } 14 | 15 | public bool ShowView => ViewModel != null; 16 | public ConsentViewModel ViewModel { get; set; } 17 | 18 | public bool HasValidationError => ValidationError != null; 19 | public string ValidationError { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Value { 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 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Device/DeviceAuthorizationInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class DeviceAuthorizationInputModel : ConsentInputModel 8 | { 9 | public string UserCode { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Device/DeviceAuthorizationViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class DeviceAuthorizationViewModel : ConsentViewModel 8 | { 9 | public string UserCode { get; set; } 10 | public bool ConfirmUserCode { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServerHost.Quickstart.UI 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorViewModel() 12 | { 13 | } 14 | 15 | public ErrorViewModel(string error) 16 | { 17 | Error = new ErrorMessage { Error = error }; 18 | } 19 | 20 | public ErrorMessage Error { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Views/Account/AccessDenied.cshtml: -------------------------------------------------------------------------------- 1 |  2 |
3 |
4 |

Access Denied

5 |

You do not have access to that resource.

6 |
7 |
-------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/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 |
9 |

10 | Logout 11 | You are now logged out 12 |

13 | 14 | @if (Model.PostLogoutRedirectUri != null) 15 | { 16 |
17 | Click here to return to the 18 | @Model.ClientName application. 19 |
20 | } 21 | 22 | @if (Model.SignOutIframeUrl != null) 23 | { 24 | 25 | } 26 |
27 | 28 | @section scripts 29 | { 30 | @if (Model.AutomaticRedirectAfterSignOut) 31 | { 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 |
5 |

Logout

6 |

Would you like to logut of IdentityServer?

7 |
8 | 9 |
10 | 11 |
12 | 13 |
14 |
15 |
16 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Views/Device/Success.cshtml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Success

5 |

You have successfully authorized the device

6 |
7 |
8 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Views/Device/UserCodeCapture.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 |
4 |
5 |

User Code

6 |

Please enter the code displayed on your device.

7 |
8 | 9 | 10 | 11 |
12 |
13 |
14 |
15 | 16 | 17 |
18 | 19 | 20 |
21 |
22 |
23 |
24 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Views/Shared/Redirect.cshtml: -------------------------------------------------------------------------------- 1 | @model RedirectViewModel 2 | 3 |
4 |
5 |

You are now being returned to the application

6 |

Once complete, you may close this tab.

7 |
8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServerHost.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | .body-container { 2 | margin-top: 60px; 3 | padding-bottom: 40px; } 4 | 5 | .welcome-page li { 6 | list-style: none; 7 | padding: 4px; } 8 | 9 | .logged-out-page iframe { 10 | display: none; 11 | width: 0; 12 | height: 0; } 13 | 14 | .grants-page .card { 15 | margin-top: 20px; 16 | border-bottom: 1px solid lightgray; } 17 | .grants-page .card .card-title { 18 | font-size: 120%; 19 | font-weight: bold; } 20 | .grants-page .card .card-title img { 21 | width: 100px; 22 | height: 100px; } 23 | .grants-page .card label { 24 | font-weight: bold; } 25 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | .body-container{margin-top:60px;padding-bottom:40px;}.welcome-page li{list-style:none;padding:4px;}.logged-out-page iframe{display:none;width:0;height:0;}.grants-page .card{margin-top:20px;border-bottom:1px solid #d3d3d3;}.grants-page .card .card-title{font-size:120%;font-weight:bold;}.grants-page .card .card-title img{width:100px;height:100px;}.grants-page .card label{font-weight:bold;} -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/css/site.scss: -------------------------------------------------------------------------------- 1 | .body-container { 2 | margin-top: 60px; 3 | padding-bottom:40px; 4 | } 5 | 6 | .welcome-page { 7 | li { 8 | list-style: none; 9 | padding: 4px; 10 | } 11 | } 12 | 13 | .logged-out-page { 14 | iframe { 15 | display: none; 16 | width: 0; 17 | height: 0; 18 | } 19 | } 20 | 21 | .grants-page { 22 | .card { 23 | margin-top: 20px; 24 | border-bottom: 1px solid lightgray; 25 | 26 | .card-title { 27 | img { 28 | width: 100px; 29 | height: 100px; 30 | } 31 | 32 | font-size: 120%; 33 | font-weight: bold; 34 | } 35 | 36 | label { 37 | font-weight: bold; 38 | } 39 | } 40 | } 41 | 42 | 43 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/aspnetcore-co-hosting/IdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/aspnetcore-co-hosting/IdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/aspnetcore-co-hosting/IdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/js/signin-redirect.js: -------------------------------------------------------------------------------- 1 | window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); 2 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/_jumbotron.scss: -------------------------------------------------------------------------------- 1 | .jumbotron { 2 | padding: $jumbotron-padding ($jumbotron-padding / 2); 3 | margin-bottom: $jumbotron-padding; 4 | color: $jumbotron-color; 5 | background-color: $jumbotron-bg; 6 | @include border-radius($border-radius-lg); 7 | 8 | @include media-breakpoint-up(sm) { 9 | padding: ($jumbotron-padding * 2) $jumbotron-padding; 10 | } 11 | } 12 | 13 | .jumbotron-fluid { 14 | padding-right: 0; 15 | padding-left: 0; 16 | @include border-radius(0); 17 | } 18 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/_media.scss: -------------------------------------------------------------------------------- 1 | .media { 2 | display: flex; 3 | align-items: flex-start; 4 | } 5 | 6 | .media-body { 7 | flex: 1; 8 | } 9 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/_root.scss: -------------------------------------------------------------------------------- 1 | // Do not forget to update getting-started/theming.md! 2 | :root { 3 | // Custom variable values only support SassScript inside `#{}`. 4 | @each $color, $value in $colors { 5 | --#{$color}: #{$value}; 6 | } 7 | 8 | @each $color, $value in $theme-colors { 9 | --#{$color}: #{$value}; 10 | } 11 | 12 | @each $bp, $value in $grid-breakpoints { 13 | --breakpoint-#{$bp}: #{$value}; 14 | } 15 | 16 | // Use `inspect` for lists so that quoted items keep the quotes. 17 | // See https://github.com/sass/sass/issues/2383#issuecomment-336349172 18 | --font-family-sans-serif: #{inspect($font-family-sans-serif)}; 19 | --font-family-monospace: #{inspect($font-family-monospace)}; 20 | } 21 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/_transitions.scss: -------------------------------------------------------------------------------- 1 | .fade { 2 | @include transition($transition-fade); 3 | 4 | &:not(.show) { 5 | opacity: 0; 6 | } 7 | } 8 | 9 | .collapse { 10 | &:not(.show) { 11 | display: none; 12 | } 13 | } 14 | 15 | .collapsing { 16 | position: relative; 17 | height: 0; 18 | overflow: hidden; 19 | @include transition($transition-collapse); 20 | } 21 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/_utilities.scss: -------------------------------------------------------------------------------- 1 | @import "utilities/align"; 2 | @import "utilities/background"; 3 | @import "utilities/borders"; 4 | @import "utilities/clearfix"; 5 | @import "utilities/display"; 6 | @import "utilities/embed"; 7 | @import "utilities/flex"; 8 | @import "utilities/float"; 9 | @import "utilities/overflow"; 10 | @import "utilities/position"; 11 | @import "utilities/screenreaders"; 12 | @import "utilities/shadows"; 13 | @import "utilities/sizing"; 14 | @import "utilities/stretched-link"; 15 | @import "utilities/spacing"; 16 | @import "utilities/text"; 17 | @import "utilities/visibility"; 18 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/bootstrap-grid.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Grid v4.4.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | */ 7 | 8 | html { 9 | box-sizing: border-box; 10 | -ms-overflow-style: scrollbar; 11 | } 12 | 13 | *, 14 | *::before, 15 | *::after { 16 | box-sizing: inherit; 17 | } 18 | 19 | @import "functions"; 20 | @import "variables"; 21 | 22 | @import "mixins/breakpoints"; 23 | @import "mixins/grid-framework"; 24 | @import "mixins/grid"; 25 | 26 | @import "grid"; 27 | @import "utilities/display"; 28 | @import "utilities/flex"; 29 | @import "utilities/spacing"; 30 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/bootstrap-reboot.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.4.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */ 8 | 9 | @import "functions"; 10 | @import "variables"; 11 | @import "mixins"; 12 | @import "reboot"; 13 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_alert.scss: -------------------------------------------------------------------------------- 1 | @mixin alert-variant($background, $border, $color) { 2 | color: $color; 3 | @include gradient-bg($background); 4 | border-color: $border; 5 | 6 | hr { 7 | border-top-color: darken($border, 5%); 8 | } 9 | 10 | .alert-link { 11 | color: darken($color, 10%); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_background-variant.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Contextual backgrounds 4 | 5 | @mixin bg-variant($parent, $color, $ignore-warning: false) { 6 | #{$parent} { 7 | background-color: $color !important; 8 | } 9 | a#{$parent}, 10 | button#{$parent} { 11 | @include hover-focus() { 12 | background-color: darken($color, 10%) !important; 13 | } 14 | } 15 | @include deprecate("The `bg-variant` mixin", "v4.4.0", "v5", $ignore-warning); 16 | } 17 | 18 | @mixin bg-gradient-variant($parent, $color) { 19 | #{$parent} { 20 | background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x !important; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_badge.scss: -------------------------------------------------------------------------------- 1 | @mixin badge-variant($bg) { 2 | color: color-yiq($bg); 3 | background-color: $bg; 4 | 5 | @at-root a#{&} { 6 | @include hover-focus() { 7 | color: color-yiq($bg); 8 | background-color: darken($bg, 10%); 9 | } 10 | 11 | &:focus, 12 | &.focus { 13 | outline: 0; 14 | box-shadow: 0 0 0 $badge-focus-width rgba($bg, .5); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_box-shadow.scss: -------------------------------------------------------------------------------- 1 | @mixin box-shadow($shadow...) { 2 | @if $enable-shadows { 3 | $result: (); 4 | 5 | @if (length($shadow) == 1) { 6 | // We can pass `@include box-shadow(none);` 7 | $result: $shadow; 8 | } @else { 9 | // Filter to avoid invalid properties for example `box-shadow: none, 1px 1px black;` 10 | @for $i from 1 through length($shadow) { 11 | @if nth($shadow, $i) != "none" { 12 | $result: append($result, nth($shadow, $i), "comma"); 13 | } 14 | } 15 | } 16 | @if (length($result) > 0) { 17 | box-shadow: $result; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_clearfix.scss: -------------------------------------------------------------------------------- 1 | @mixin clearfix() { 2 | &::after { 3 | display: block; 4 | clear: both; 5 | content: ""; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_deprecate.scss: -------------------------------------------------------------------------------- 1 | // Deprecate mixin 2 | // 3 | // This mixin can be used to deprecate mixins or functions. 4 | // `$enable-deprecation-messages` is a global variable, `$ignore-warning` is a variable that can be passed to 5 | // some deprecated mixins to suppress the warning (for example if the mixin is still be used in the current version of Bootstrap) 6 | @mixin deprecate($name, $deprecate-version, $remove-version, $ignore-warning: false) { 7 | @if ($enable-deprecation-messages != false and $ignore-warning != true) { 8 | @warn "#{$name} has been deprecated as of #{$deprecate-version}. It will be removed entirely in #{$remove-version}."; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_float.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @mixin float-left() { 4 | float: left !important; 5 | @include deprecate("The `float-left` mixin", "v4.3.0", "v5"); 6 | } 7 | @mixin float-right() { 8 | float: right !important; 9 | @include deprecate("The `float-right` mixin", "v4.3.0", "v5"); 10 | } 11 | @mixin float-none() { 12 | float: none !important; 13 | @include deprecate("The `float-none` mixin", "v4.3.0", "v5"); 14 | } 15 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_hover.scss: -------------------------------------------------------------------------------- 1 | // Hover mixin and `$enable-hover-media-query` are deprecated. 2 | // 3 | // Originally added during our alphas and maintained during betas, this mixin was 4 | // designed to prevent `:hover` stickiness on iOS-an issue where hover styles 5 | // would persist after initial touch. 6 | // 7 | // For backward compatibility, we've kept these mixins and updated them to 8 | // always return their regular pseudo-classes instead of a shimmed media query. 9 | // 10 | // Issue: https://github.com/twbs/bootstrap/issues/25195 11 | 12 | @mixin hover() { 13 | &:hover { @content; } 14 | } 15 | 16 | @mixin hover-focus() { 17 | &:hover, 18 | &:focus { 19 | @content; 20 | } 21 | } 22 | 23 | @mixin plain-hover-focus() { 24 | &, 25 | &:hover, 26 | &:focus { 27 | @content; 28 | } 29 | } 30 | 31 | @mixin hover-focus-active() { 32 | &:hover, 33 | &:focus, 34 | &:active { 35 | @content; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_list-group.scss: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | @mixin list-group-item-variant($state, $background, $color) { 4 | .list-group-item-#{$state} { 5 | color: $color; 6 | background-color: $background; 7 | 8 | &.list-group-item-action { 9 | @include hover-focus() { 10 | color: $color; 11 | background-color: darken($background, 5%); 12 | } 13 | 14 | &.active { 15 | color: $white; 16 | background-color: $color; 17 | border-color: $color; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_lists.scss: -------------------------------------------------------------------------------- 1 | // Lists 2 | 3 | // Unstyled keeps list items block level, just removes default browser padding and list-style 4 | @mixin list-unstyled() { 5 | padding-left: 0; 6 | list-style: none; 7 | } 8 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_nav-divider.scss: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | @mixin nav-divider($color: $nav-divider-color, $margin-y: $nav-divider-margin-y, $ignore-warning: false) { 6 | height: 0; 7 | margin: $margin-y 0; 8 | overflow: hidden; 9 | border-top: 1px solid $color; 10 | @include deprecate("The `nav-divider()` mixin", "v4.4.0", "v5", $ignore-warning); 11 | } 12 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_pagination.scss: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | @mixin pagination-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) { 4 | .page-link { 5 | padding: $padding-y $padding-x; 6 | @include font-size($font-size); 7 | line-height: $line-height; 8 | } 9 | 10 | .page-item { 11 | &:first-child { 12 | .page-link { 13 | @include border-left-radius($border-radius); 14 | } 15 | } 16 | &:last-child { 17 | .page-link { 18 | @include border-right-radius($border-radius); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_reset-text.scss: -------------------------------------------------------------------------------- 1 | @mixin reset-text() { 2 | font-family: $font-family-base; 3 | // We deliberately do NOT reset font-size or word-wrap. 4 | font-style: normal; 5 | font-weight: $font-weight-normal; 6 | line-height: $line-height-base; 7 | text-align: left; // Fallback for where `start` is not supported 8 | text-align: start; 9 | text-decoration: none; 10 | text-shadow: none; 11 | text-transform: none; 12 | letter-spacing: normal; 13 | word-break: normal; 14 | word-spacing: normal; 15 | white-space: normal; 16 | line-break: auto; 17 | } 18 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_resize.scss: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | @mixin resizable($direction) { 4 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 5 | resize: $direction; // Options: horizontal, vertical, both 6 | } 7 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_size.scss: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | @mixin size($width, $height: $width) { 4 | width: $width; 5 | height: $height; 6 | @include deprecate("`size()`", "v4.3.0", "v5"); 7 | } 8 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_text-emphasis.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Typography 4 | 5 | @mixin text-emphasis-variant($parent, $color, $ignore-warning: false) { 6 | #{$parent} { 7 | color: $color !important; 8 | } 9 | @if $emphasized-link-hover-darken-percentage != 0 { 10 | a#{$parent} { 11 | @include hover-focus() { 12 | color: darken($color, $emphasized-link-hover-darken-percentage) !important; 13 | } 14 | } 15 | } 16 | @include deprecate("`text-emphasis-variant()`", "v4.4.0", "v5", $ignore-warning); 17 | } 18 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_text-hide.scss: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | @mixin text-hide($ignore-warning: false) { 3 | // stylelint-disable-next-line font-family-no-missing-generic-family-keyword 4 | font: 0/0 a; 5 | color: transparent; 6 | text-shadow: none; 7 | background-color: transparent; 8 | border: 0; 9 | 10 | @include deprecate("`text-hide()`", "v4.1.0", "v5", $ignore-warning); 11 | } 12 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_text-truncate.scss: -------------------------------------------------------------------------------- 1 | // Text truncate 2 | // Requires inline-block or block for proper styling 3 | 4 | @mixin text-truncate() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_transition.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable property-blacklist 2 | @mixin transition($transition...) { 3 | @if $enable-transitions { 4 | @if length($transition) == 0 { 5 | transition: $transition-base; 6 | } @else { 7 | transition: $transition; 8 | } 9 | } 10 | 11 | @if $enable-prefers-reduced-motion-media-query { 12 | @media (prefers-reduced-motion: reduce) { 13 | transition: none; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_visibility.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Visibility 4 | 5 | @mixin invisible($visibility) { 6 | visibility: $visibility !important; 7 | @include deprecate("`invisible()`", "v4.3.0", "v5"); 8 | } 9 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_align.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | .align-baseline { vertical-align: baseline !important; } // Browser default 4 | .align-top { vertical-align: top !important; } 5 | .align-middle { vertical-align: middle !important; } 6 | .align-bottom { vertical-align: bottom !important; } 7 | .align-text-bottom { vertical-align: text-bottom !important; } 8 | .align-text-top { vertical-align: text-top !important; } 9 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_background.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @each $color, $value in $theme-colors { 4 | @include bg-variant(".bg-#{$color}", $value, true); 5 | } 6 | 7 | @if $enable-gradients { 8 | @each $color, $value in $theme-colors { 9 | @include bg-gradient-variant(".bg-gradient-#{$color}", $value); 10 | } 11 | } 12 | 13 | .bg-white { 14 | background-color: $white !important; 15 | } 16 | 17 | .bg-transparent { 18 | background-color: transparent !important; 19 | } 20 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_clearfix.scss: -------------------------------------------------------------------------------- 1 | .clearfix { 2 | @include clearfix(); 3 | } 4 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_display.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // 4 | // Utilities for common `display` values 5 | // 6 | 7 | @each $breakpoint in map-keys($grid-breakpoints) { 8 | @include media-breakpoint-up($breakpoint) { 9 | $infix: breakpoint-infix($breakpoint, $grid-breakpoints); 10 | 11 | @each $value in $displays { 12 | .d#{$infix}-#{$value} { display: $value !important; } 13 | } 14 | } 15 | } 16 | 17 | 18 | // 19 | // Utilities for toggling `display` in print 20 | // 21 | 22 | @media print { 23 | @each $value in $displays { 24 | .d-print-#{$value} { display: $value !important; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_float.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @each $breakpoint in map-keys($grid-breakpoints) { 4 | @include media-breakpoint-up($breakpoint) { 5 | $infix: breakpoint-infix($breakpoint, $grid-breakpoints); 6 | 7 | .float#{$infix}-left { float: left !important; } 8 | .float#{$infix}-right { float: right !important; } 9 | .float#{$infix}-none { float: none !important; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_overflow.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @each $value in $overflows { 4 | .overflow-#{$value} { overflow: $value !important; } 5 | } 6 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_position.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Common values 4 | @each $position in $positions { 5 | .position-#{$position} { position: $position !important; } 6 | } 7 | 8 | // Shorthand 9 | 10 | .fixed-top { 11 | position: fixed; 12 | top: 0; 13 | right: 0; 14 | left: 0; 15 | z-index: $zindex-fixed; 16 | } 17 | 18 | .fixed-bottom { 19 | position: fixed; 20 | right: 0; 21 | bottom: 0; 22 | left: 0; 23 | z-index: $zindex-fixed; 24 | } 25 | 26 | .sticky-top { 27 | @supports (position: sticky) { 28 | position: sticky; 29 | top: 0; 30 | z-index: $zindex-sticky; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_screenreaders.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Screenreaders 3 | // 4 | 5 | .sr-only { 6 | @include sr-only(); 7 | } 8 | 9 | .sr-only-focusable { 10 | @include sr-only-focusable(); 11 | } 12 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_shadows.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | .shadow-sm { box-shadow: $box-shadow-sm !important; } 4 | .shadow { box-shadow: $box-shadow !important; } 5 | .shadow-lg { box-shadow: $box-shadow-lg !important; } 6 | .shadow-none { box-shadow: none !important; } 7 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_sizing.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Width and height 4 | 5 | @each $prop, $abbrev in (width: w, height: h) { 6 | @each $size, $length in $sizes { 7 | .#{$abbrev}-#{$size} { #{$prop}: $length !important; } 8 | } 9 | } 10 | 11 | .mw-100 { max-width: 100% !important; } 12 | .mh-100 { max-height: 100% !important; } 13 | 14 | // Viewport additional helpers 15 | 16 | .min-vw-100 { min-width: 100vw !important; } 17 | .min-vh-100 { min-height: 100vh !important; } 18 | 19 | .vw-100 { width: 100vw !important; } 20 | .vh-100 { height: 100vh !important; } 21 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_stretched-link.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Stretched link 3 | // 4 | 5 | .stretched-link { 6 | &::after { 7 | position: absolute; 8 | top: 0; 9 | right: 0; 10 | bottom: 0; 11 | left: 0; 12 | z-index: 1; 13 | // Just in case `pointer-events: none` is set on a parent 14 | pointer-events: auto; 15 | content: ""; 16 | // IE10 bugfix, see https://stackoverflow.com/questions/16947967/ie10-hover-pseudo-class-doesnt-work-without-background-color 17 | background-color: rgba(0, 0, 0, 0); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_visibility.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // 4 | // Visibility utilities 5 | // 6 | 7 | .visible { 8 | visibility: visible !important; 9 | } 10 | 11 | .invisible { 12 | visibility: hidden !important; 13 | } 14 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/WebClient/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace WebClient 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/WebClient/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:33292", 7 | "sslPort": 44343 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WebClient": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:5004;https://localhost:5005" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/WebClient/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | 10 | Index 11 | 12 | 13 |
14 | Go to user profile 15 | 16 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/WebClient/Views/Home/UserProfile.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | 10 | UserProfile 11 | 12 | 13 |

UserProfile

14 |

@ViewBag.Response

15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/WebClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | 3 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/WebClient/WebClient.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/WebClient/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/aspnetcore-co-hosting/WebClient/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /samples/dotnet-5/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/dotnet-5/Api/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace Api 5 | { 6 | public static class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | private static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/dotnet-5/Api/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:32733", 7 | "sslPort": 44346 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Api": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:5002;https://localhost:5003" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/dotnet-5/Api/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/dotnet-5/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/dotnet-5/ConsoleClient/ConsoleClient.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/dotnet-5/Grains/Grains.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | all 10 | runtime; build; native; contentfiles; analyzers 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/dotnet-5/GrainsInterfaces/AuthorizationConfig.cs: -------------------------------------------------------------------------------- 1 | using Orleans.Security.Authorization; 2 | 3 | namespace GrainsInterfaces 4 | { 5 | public static class AuthorizationConfig 6 | { 7 | public static void ConfigureOptions(AuthorizationOptions options) 8 | { 9 | options.AddPolicy("AdminPolicy", policy => policy.RequireRole("Admin")); 10 | options.AddPolicy("ManagerPolicy", policy => policy.RequireRole("Manager")); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/dotnet-5/GrainsInterfaces/GrainsInterfaces.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | all 11 | runtime; build; native; contentfiles; analyzers 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/dotnet-5/GrainsInterfaces/IGlobalSecretStorageGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans; 3 | using Orleans.Security.Authorization; 4 | 5 | namespace GrainsInterfaces 6 | { 7 | public interface IGlobalSecretStorageGrain : IGrainWithStringKey 8 | { 9 | [Authorize(Roles = "Admin")] 10 | Task TakeUserSecret(string userId); 11 | } 12 | } -------------------------------------------------------------------------------- /samples/dotnet-5/GrainsInterfaces/IUserGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans; 3 | using Orleans.Security.Authorization; 4 | 5 | namespace GrainsInterfaces 6 | { 7 | public interface IUserGrain : IGrainWithStringKey 8 | { 9 | [Authorize(Policy = "ManagerPolicy")] 10 | Task TakeSecret(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/IdentityServer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | IdentityServer4 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using IdentityServer4; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Configuration; 8 | using Microsoft.Extensions.Hosting; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace IdentityServer4 12 | { 13 | internal static class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateHostBuilder(args).Build().Run(); 18 | } 19 | 20 | private static IHostBuilder CreateHostBuilder(string[] args) => 21 | Host.CreateDefaultBuilder(args) 22 | .ConfigureWebHostDefaults(webBuilder => 23 | { 24 | webBuilder.UseStartup(); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:7600", 7 | "sslPort": 44396 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "IdentityServer": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:5000;https://localhost:5001" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/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 IdentityServerHost.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 | public static string InvalidCredentialsErrorMessage = "Invalid username or password"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/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 IdentityServerHost.Quickstart.UI 6 | { 7 | public class LoggedOutViewModel 8 | { 9 | public string PostLogoutRedirectUri { get; set; } 10 | public string ClientName { get; set; } 11 | public string SignOutIframeUrl { get; set; } 12 | 13 | public bool AutomaticRedirectAfterSignOut { get; set; } 14 | 15 | public string LogoutId { get; set; } 16 | public bool TriggerExternalSignout => ExternalAuthenticationScheme != null; 17 | public string ExternalAuthenticationScheme { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace IdentityServerHost.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 | } -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Account/RedirectViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | 6 | namespace IdentityServerHost.Quickstart.UI 7 | { 8 | public class RedirectViewModel 9 | { 10 | public string RedirectUrl { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace IdentityServerHost.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 | public string Description { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/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 IdentityServerHost.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 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/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 IdentityServerHost.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 ApiScopes { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServerHost.Quickstart.UI 8 | { 9 | public class ProcessConsentResult 10 | { 11 | public bool IsRedirect => RedirectUri != null; 12 | public string RedirectUri { get; set; } 13 | public Client Client { get; set; } 14 | 15 | public bool ShowView => ViewModel != null; 16 | public ConsentViewModel ViewModel { get; set; } 17 | 18 | public bool HasValidationError => ValidationError != null; 19 | public string ValidationError { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class ScopeViewModel 8 | { 9 | public string Value { 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 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Device/DeviceAuthorizationInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class DeviceAuthorizationInputModel : ConsentInputModel 8 | { 9 | public string UserCode { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Device/DeviceAuthorizationViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServerHost.Quickstart.UI 6 | { 7 | public class DeviceAuthorizationViewModel : ConsentViewModel 8 | { 9 | public string UserCode { get; set; } 10 | public bool ConfirmUserCode { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServerHost.Quickstart.UI 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorViewModel() 12 | { 13 | } 14 | 15 | public ErrorViewModel(string error) 16 | { 17 | Error = new ErrorMessage { Error = error }; 18 | } 19 | 20 | public ErrorMessage Error { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Views/Account/AccessDenied.cshtml: -------------------------------------------------------------------------------- 1 |  2 |
3 |
4 |

Access Denied

5 |

You do not have access to that resource.

6 |
7 |
-------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/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 |
9 |

10 | Logout 11 | You are now logged out 12 |

13 | 14 | @if (Model.PostLogoutRedirectUri != null) 15 | { 16 |
17 | Click here to return to the 18 | @Model.ClientName application. 19 |
20 | } 21 | 22 | @if (Model.SignOutIframeUrl != null) 23 | { 24 | 25 | } 26 |
27 | 28 | @section scripts 29 | { 30 | @if (Model.AutomaticRedirectAfterSignOut) 31 | { 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 |
5 |

Logout

6 |

Would you like to logut of IdentityServer?

7 |
8 | 9 |
10 | 11 |
12 | 13 |
14 |
15 |
16 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Views/Device/Success.cshtml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Success

5 |

You have successfully authorized the device

6 |
7 |
8 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Views/Device/UserCodeCapture.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 |
4 |
5 |

User Code

6 |

Please enter the code displayed on your device.

7 |
8 | 9 | 10 | 11 |
12 |
13 |
14 |
15 | 16 | 17 |
18 | 19 | 20 |
21 |
22 |
23 |
24 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Views/Shared/Redirect.cshtml: -------------------------------------------------------------------------------- 1 | @model RedirectViewModel 2 | 3 |
4 |
5 |

You are now being returned to the application

6 |

Once complete, you may close this tab.

7 |
8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServerHost.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | .body-container { 2 | margin-top: 60px; 3 | padding-bottom: 40px; } 4 | 5 | .welcome-page li { 6 | list-style: none; 7 | padding: 4px; } 8 | 9 | .logged-out-page iframe { 10 | display: none; 11 | width: 0; 12 | height: 0; } 13 | 14 | .grants-page .card { 15 | margin-top: 20px; 16 | border-bottom: 1px solid lightgray; } 17 | .grants-page .card .card-title { 18 | font-size: 120%; 19 | font-weight: bold; } 20 | .grants-page .card .card-title img { 21 | width: 100px; 22 | height: 100px; } 23 | .grants-page .card label { 24 | font-weight: bold; } 25 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | .body-container{margin-top:60px;padding-bottom:40px;}.welcome-page li{list-style:none;padding:4px;}.logged-out-page iframe{display:none;width:0;height:0;}.grants-page .card{margin-top:20px;border-bottom:1px solid #d3d3d3;}.grants-page .card .card-title{font-size:120%;font-weight:bold;}.grants-page .card .card-title img{width:100px;height:100px;}.grants-page .card label{font-weight:bold;} -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/css/site.scss: -------------------------------------------------------------------------------- 1 | .body-container { 2 | margin-top: 60px; 3 | padding-bottom:40px; 4 | } 5 | 6 | .welcome-page { 7 | li { 8 | list-style: none; 9 | padding: 4px; 10 | } 11 | } 12 | 13 | .logged-out-page { 14 | iframe { 15 | display: none; 16 | width: 0; 17 | height: 0; 18 | } 19 | } 20 | 21 | .grants-page { 22 | .card { 23 | margin-top: 20px; 24 | border-bottom: 1px solid lightgray; 25 | 26 | .card-title { 27 | img { 28 | width: 100px; 29 | height: 100px; 30 | } 31 | 32 | font-size: 120%; 33 | font-weight: bold; 34 | } 35 | 36 | label { 37 | font-weight: bold; 38 | } 39 | } 40 | } 41 | 42 | 43 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnet-5/IdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnet-5/IdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnet-5/IdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/js/signin-redirect.js: -------------------------------------------------------------------------------- 1 | window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); 2 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/_jumbotron.scss: -------------------------------------------------------------------------------- 1 | .jumbotron { 2 | padding: $jumbotron-padding ($jumbotron-padding / 2); 3 | margin-bottom: $jumbotron-padding; 4 | color: $jumbotron-color; 5 | background-color: $jumbotron-bg; 6 | @include border-radius($border-radius-lg); 7 | 8 | @include media-breakpoint-up(sm) { 9 | padding: ($jumbotron-padding * 2) $jumbotron-padding; 10 | } 11 | } 12 | 13 | .jumbotron-fluid { 14 | padding-right: 0; 15 | padding-left: 0; 16 | @include border-radius(0); 17 | } 18 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/_media.scss: -------------------------------------------------------------------------------- 1 | .media { 2 | display: flex; 3 | align-items: flex-start; 4 | } 5 | 6 | .media-body { 7 | flex: 1; 8 | } 9 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/_root.scss: -------------------------------------------------------------------------------- 1 | // Do not forget to update getting-started/theming.md! 2 | :root { 3 | // Custom variable values only support SassScript inside `#{}`. 4 | @each $color, $value in $colors { 5 | --#{$color}: #{$value}; 6 | } 7 | 8 | @each $color, $value in $theme-colors { 9 | --#{$color}: #{$value}; 10 | } 11 | 12 | @each $bp, $value in $grid-breakpoints { 13 | --breakpoint-#{$bp}: #{$value}; 14 | } 15 | 16 | // Use `inspect` for lists so that quoted items keep the quotes. 17 | // See https://github.com/sass/sass/issues/2383#issuecomment-336349172 18 | --font-family-sans-serif: #{inspect($font-family-sans-serif)}; 19 | --font-family-monospace: #{inspect($font-family-monospace)}; 20 | } 21 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/_transitions.scss: -------------------------------------------------------------------------------- 1 | .fade { 2 | @include transition($transition-fade); 3 | 4 | &:not(.show) { 5 | opacity: 0; 6 | } 7 | } 8 | 9 | .collapse { 10 | &:not(.show) { 11 | display: none; 12 | } 13 | } 14 | 15 | .collapsing { 16 | position: relative; 17 | height: 0; 18 | overflow: hidden; 19 | @include transition($transition-collapse); 20 | } 21 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/_utilities.scss: -------------------------------------------------------------------------------- 1 | @import "utilities/align"; 2 | @import "utilities/background"; 3 | @import "utilities/borders"; 4 | @import "utilities/clearfix"; 5 | @import "utilities/display"; 6 | @import "utilities/embed"; 7 | @import "utilities/flex"; 8 | @import "utilities/float"; 9 | @import "utilities/overflow"; 10 | @import "utilities/position"; 11 | @import "utilities/screenreaders"; 12 | @import "utilities/shadows"; 13 | @import "utilities/sizing"; 14 | @import "utilities/stretched-link"; 15 | @import "utilities/spacing"; 16 | @import "utilities/text"; 17 | @import "utilities/visibility"; 18 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/bootstrap-grid.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Grid v4.4.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | */ 7 | 8 | html { 9 | box-sizing: border-box; 10 | -ms-overflow-style: scrollbar; 11 | } 12 | 13 | *, 14 | *::before, 15 | *::after { 16 | box-sizing: inherit; 17 | } 18 | 19 | @import "functions"; 20 | @import "variables"; 21 | 22 | @import "mixins/breakpoints"; 23 | @import "mixins/grid-framework"; 24 | @import "mixins/grid"; 25 | 26 | @import "grid"; 27 | @import "utilities/display"; 28 | @import "utilities/flex"; 29 | @import "utilities/spacing"; 30 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/bootstrap-reboot.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.4.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */ 8 | 9 | @import "functions"; 10 | @import "variables"; 11 | @import "mixins"; 12 | @import "reboot"; 13 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_alert.scss: -------------------------------------------------------------------------------- 1 | @mixin alert-variant($background, $border, $color) { 2 | color: $color; 3 | @include gradient-bg($background); 4 | border-color: $border; 5 | 6 | hr { 7 | border-top-color: darken($border, 5%); 8 | } 9 | 10 | .alert-link { 11 | color: darken($color, 10%); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_background-variant.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Contextual backgrounds 4 | 5 | @mixin bg-variant($parent, $color, $ignore-warning: false) { 6 | #{$parent} { 7 | background-color: $color !important; 8 | } 9 | a#{$parent}, 10 | button#{$parent} { 11 | @include hover-focus() { 12 | background-color: darken($color, 10%) !important; 13 | } 14 | } 15 | @include deprecate("The `bg-variant` mixin", "v4.4.0", "v5", $ignore-warning); 16 | } 17 | 18 | @mixin bg-gradient-variant($parent, $color) { 19 | #{$parent} { 20 | background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x !important; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_badge.scss: -------------------------------------------------------------------------------- 1 | @mixin badge-variant($bg) { 2 | color: color-yiq($bg); 3 | background-color: $bg; 4 | 5 | @at-root a#{&} { 6 | @include hover-focus() { 7 | color: color-yiq($bg); 8 | background-color: darken($bg, 10%); 9 | } 10 | 11 | &:focus, 12 | &.focus { 13 | outline: 0; 14 | box-shadow: 0 0 0 $badge-focus-width rgba($bg, .5); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_box-shadow.scss: -------------------------------------------------------------------------------- 1 | @mixin box-shadow($shadow...) { 2 | @if $enable-shadows { 3 | $result: (); 4 | 5 | @if (length($shadow) == 1) { 6 | // We can pass `@include box-shadow(none);` 7 | $result: $shadow; 8 | } @else { 9 | // Filter to avoid invalid properties for example `box-shadow: none, 1px 1px black;` 10 | @for $i from 1 through length($shadow) { 11 | @if nth($shadow, $i) != "none" { 12 | $result: append($result, nth($shadow, $i), "comma"); 13 | } 14 | } 15 | } 16 | @if (length($result) > 0) { 17 | box-shadow: $result; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_clearfix.scss: -------------------------------------------------------------------------------- 1 | @mixin clearfix() { 2 | &::after { 3 | display: block; 4 | clear: both; 5 | content: ""; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_deprecate.scss: -------------------------------------------------------------------------------- 1 | // Deprecate mixin 2 | // 3 | // This mixin can be used to deprecate mixins or functions. 4 | // `$enable-deprecation-messages` is a global variable, `$ignore-warning` is a variable that can be passed to 5 | // some deprecated mixins to suppress the warning (for example if the mixin is still be used in the current version of Bootstrap) 6 | @mixin deprecate($name, $deprecate-version, $remove-version, $ignore-warning: false) { 7 | @if ($enable-deprecation-messages != false and $ignore-warning != true) { 8 | @warn "#{$name} has been deprecated as of #{$deprecate-version}. It will be removed entirely in #{$remove-version}."; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_float.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @mixin float-left() { 4 | float: left !important; 5 | @include deprecate("The `float-left` mixin", "v4.3.0", "v5"); 6 | } 7 | @mixin float-right() { 8 | float: right !important; 9 | @include deprecate("The `float-right` mixin", "v4.3.0", "v5"); 10 | } 11 | @mixin float-none() { 12 | float: none !important; 13 | @include deprecate("The `float-none` mixin", "v4.3.0", "v5"); 14 | } 15 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_hover.scss: -------------------------------------------------------------------------------- 1 | // Hover mixin and `$enable-hover-media-query` are deprecated. 2 | // 3 | // Originally added during our alphas and maintained during betas, this mixin was 4 | // designed to prevent `:hover` stickiness on iOS-an issue where hover styles 5 | // would persist after initial touch. 6 | // 7 | // For backward compatibility, we've kept these mixins and updated them to 8 | // always return their regular pseudo-classes instead of a shimmed media query. 9 | // 10 | // Issue: https://github.com/twbs/bootstrap/issues/25195 11 | 12 | @mixin hover() { 13 | &:hover { @content; } 14 | } 15 | 16 | @mixin hover-focus() { 17 | &:hover, 18 | &:focus { 19 | @content; 20 | } 21 | } 22 | 23 | @mixin plain-hover-focus() { 24 | &, 25 | &:hover, 26 | &:focus { 27 | @content; 28 | } 29 | } 30 | 31 | @mixin hover-focus-active() { 32 | &:hover, 33 | &:focus, 34 | &:active { 35 | @content; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_list-group.scss: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | @mixin list-group-item-variant($state, $background, $color) { 4 | .list-group-item-#{$state} { 5 | color: $color; 6 | background-color: $background; 7 | 8 | &.list-group-item-action { 9 | @include hover-focus() { 10 | color: $color; 11 | background-color: darken($background, 5%); 12 | } 13 | 14 | &.active { 15 | color: $white; 16 | background-color: $color; 17 | border-color: $color; 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_lists.scss: -------------------------------------------------------------------------------- 1 | // Lists 2 | 3 | // Unstyled keeps list items block level, just removes default browser padding and list-style 4 | @mixin list-unstyled() { 5 | padding-left: 0; 6 | list-style: none; 7 | } 8 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_nav-divider.scss: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | @mixin nav-divider($color: $nav-divider-color, $margin-y: $nav-divider-margin-y, $ignore-warning: false) { 6 | height: 0; 7 | margin: $margin-y 0; 8 | overflow: hidden; 9 | border-top: 1px solid $color; 10 | @include deprecate("The `nav-divider()` mixin", "v4.4.0", "v5", $ignore-warning); 11 | } 12 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_pagination.scss: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | @mixin pagination-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) { 4 | .page-link { 5 | padding: $padding-y $padding-x; 6 | @include font-size($font-size); 7 | line-height: $line-height; 8 | } 9 | 10 | .page-item { 11 | &:first-child { 12 | .page-link { 13 | @include border-left-radius($border-radius); 14 | } 15 | } 16 | &:last-child { 17 | .page-link { 18 | @include border-right-radius($border-radius); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_reset-text.scss: -------------------------------------------------------------------------------- 1 | @mixin reset-text() { 2 | font-family: $font-family-base; 3 | // We deliberately do NOT reset font-size or word-wrap. 4 | font-style: normal; 5 | font-weight: $font-weight-normal; 6 | line-height: $line-height-base; 7 | text-align: left; // Fallback for where `start` is not supported 8 | text-align: start; 9 | text-decoration: none; 10 | text-shadow: none; 11 | text-transform: none; 12 | letter-spacing: normal; 13 | word-break: normal; 14 | word-spacing: normal; 15 | white-space: normal; 16 | line-break: auto; 17 | } 18 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_resize.scss: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | @mixin resizable($direction) { 4 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 5 | resize: $direction; // Options: horizontal, vertical, both 6 | } 7 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_size.scss: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | @mixin size($width, $height: $width) { 4 | width: $width; 5 | height: $height; 6 | @include deprecate("`size()`", "v4.3.0", "v5"); 7 | } 8 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_text-emphasis.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Typography 4 | 5 | @mixin text-emphasis-variant($parent, $color, $ignore-warning: false) { 6 | #{$parent} { 7 | color: $color !important; 8 | } 9 | @if $emphasized-link-hover-darken-percentage != 0 { 10 | a#{$parent} { 11 | @include hover-focus() { 12 | color: darken($color, $emphasized-link-hover-darken-percentage) !important; 13 | } 14 | } 15 | } 16 | @include deprecate("`text-emphasis-variant()`", "v4.4.0", "v5", $ignore-warning); 17 | } 18 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_text-hide.scss: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | @mixin text-hide($ignore-warning: false) { 3 | // stylelint-disable-next-line font-family-no-missing-generic-family-keyword 4 | font: 0/0 a; 5 | color: transparent; 6 | text-shadow: none; 7 | background-color: transparent; 8 | border: 0; 9 | 10 | @include deprecate("`text-hide()`", "v4.1.0", "v5", $ignore-warning); 11 | } 12 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_text-truncate.scss: -------------------------------------------------------------------------------- 1 | // Text truncate 2 | // Requires inline-block or block for proper styling 3 | 4 | @mixin text-truncate() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_transition.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable property-blacklist 2 | @mixin transition($transition...) { 3 | @if $enable-transitions { 4 | @if length($transition) == 0 { 5 | transition: $transition-base; 6 | } @else { 7 | transition: $transition; 8 | } 9 | } 10 | 11 | @if $enable-prefers-reduced-motion-media-query { 12 | @media (prefers-reduced-motion: reduce) { 13 | transition: none; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/mixins/_visibility.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Visibility 4 | 5 | @mixin invisible($visibility) { 6 | visibility: $visibility !important; 7 | @include deprecate("`invisible()`", "v4.3.0", "v5"); 8 | } 9 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_align.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | .align-baseline { vertical-align: baseline !important; } // Browser default 4 | .align-top { vertical-align: top !important; } 5 | .align-middle { vertical-align: middle !important; } 6 | .align-bottom { vertical-align: bottom !important; } 7 | .align-text-bottom { vertical-align: text-bottom !important; } 8 | .align-text-top { vertical-align: text-top !important; } 9 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_background.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @each $color, $value in $theme-colors { 4 | @include bg-variant(".bg-#{$color}", $value, true); 5 | } 6 | 7 | @if $enable-gradients { 8 | @each $color, $value in $theme-colors { 9 | @include bg-gradient-variant(".bg-gradient-#{$color}", $value); 10 | } 11 | } 12 | 13 | .bg-white { 14 | background-color: $white !important; 15 | } 16 | 17 | .bg-transparent { 18 | background-color: transparent !important; 19 | } 20 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_clearfix.scss: -------------------------------------------------------------------------------- 1 | .clearfix { 2 | @include clearfix(); 3 | } 4 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_display.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // 4 | // Utilities for common `display` values 5 | // 6 | 7 | @each $breakpoint in map-keys($grid-breakpoints) { 8 | @include media-breakpoint-up($breakpoint) { 9 | $infix: breakpoint-infix($breakpoint, $grid-breakpoints); 10 | 11 | @each $value in $displays { 12 | .d#{$infix}-#{$value} { display: $value !important; } 13 | } 14 | } 15 | } 16 | 17 | 18 | // 19 | // Utilities for toggling `display` in print 20 | // 21 | 22 | @media print { 23 | @each $value in $displays { 24 | .d-print-#{$value} { display: $value !important; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_float.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @each $breakpoint in map-keys($grid-breakpoints) { 4 | @include media-breakpoint-up($breakpoint) { 5 | $infix: breakpoint-infix($breakpoint, $grid-breakpoints); 6 | 7 | .float#{$infix}-left { float: left !important; } 8 | .float#{$infix}-right { float: right !important; } 9 | .float#{$infix}-none { float: none !important; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_overflow.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @each $value in $overflows { 4 | .overflow-#{$value} { overflow: $value !important; } 5 | } 6 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_position.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Common values 4 | @each $position in $positions { 5 | .position-#{$position} { position: $position !important; } 6 | } 7 | 8 | // Shorthand 9 | 10 | .fixed-top { 11 | position: fixed; 12 | top: 0; 13 | right: 0; 14 | left: 0; 15 | z-index: $zindex-fixed; 16 | } 17 | 18 | .fixed-bottom { 19 | position: fixed; 20 | right: 0; 21 | bottom: 0; 22 | left: 0; 23 | z-index: $zindex-fixed; 24 | } 25 | 26 | .sticky-top { 27 | @supports (position: sticky) { 28 | position: sticky; 29 | top: 0; 30 | z-index: $zindex-sticky; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_screenreaders.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Screenreaders 3 | // 4 | 5 | .sr-only { 6 | @include sr-only(); 7 | } 8 | 9 | .sr-only-focusable { 10 | @include sr-only-focusable(); 11 | } 12 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_shadows.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | .shadow-sm { box-shadow: $box-shadow-sm !important; } 4 | .shadow { box-shadow: $box-shadow !important; } 5 | .shadow-lg { box-shadow: $box-shadow-lg !important; } 6 | .shadow-none { box-shadow: none !important; } 7 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_sizing.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Width and height 4 | 5 | @each $prop, $abbrev in (width: w, height: h) { 6 | @each $size, $length in $sizes { 7 | .#{$abbrev}-#{$size} { #{$prop}: $length !important; } 8 | } 9 | } 10 | 11 | .mw-100 { max-width: 100% !important; } 12 | .mh-100 { max-height: 100% !important; } 13 | 14 | // Viewport additional helpers 15 | 16 | .min-vw-100 { min-width: 100vw !important; } 17 | .min-vh-100 { min-height: 100vh !important; } 18 | 19 | .vw-100 { width: 100vw !important; } 20 | .vh-100 { height: 100vh !important; } 21 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_stretched-link.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Stretched link 3 | // 4 | 5 | .stretched-link { 6 | &::after { 7 | position: absolute; 8 | top: 0; 9 | right: 0; 10 | bottom: 0; 11 | left: 0; 12 | z-index: 1; 13 | // Just in case `pointer-events: none` is set on a parent 14 | pointer-events: auto; 15 | content: ""; 16 | // IE10 bugfix, see https://stackoverflow.com/questions/16947967/ie10-hover-pseudo-class-doesnt-work-without-background-color 17 | background-color: rgba(0, 0, 0, 0); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/dotnet-5/IdentityServer/wwwroot/lib/bootstrap/scss/utilities/_visibility.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // 4 | // Visibility utilities 5 | // 6 | 7 | .visible { 8 | visibility: visible !important; 9 | } 10 | 11 | .invisible { 12 | visibility: hidden !important; 13 | } 14 | -------------------------------------------------------------------------------- /samples/dotnet-5/WebClient/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace WebClient 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/dotnet-5/WebClient/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:33292", 7 | "sslPort": 44343 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WebClient": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:5004;https://localhost:5005" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/dotnet-5/WebClient/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | 10 | Index 11 | 12 | 13 |
14 | Go to user profile 15 | 16 | -------------------------------------------------------------------------------- /samples/dotnet-5/WebClient/Views/Home/UserProfile.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | 10 | UserProfile 11 | 12 | 13 |

UserProfile

14 |

@ViewBag.Response

15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/dotnet-5/WebClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | 3 | -------------------------------------------------------------------------------- /samples/dotnet-5/WebClient/WebClient.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/dotnet-5/WebClient/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/dotnet-5/WebClient/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/Api/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.Hosting; 10 | using Microsoft.Extensions.Logging; 11 | 12 | namespace Api 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IHostBuilder CreateHostBuilder(string[] args) => 22 | Host.CreateDefaultBuilder(args) 23 | .ConfigureWebHostDefaults(webBuilder => 24 | { 25 | webBuilder.UseStartup(); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/Api/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:32733", 7 | "sslPort": 44346 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Api": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "https://localhost:5002;http://localhost:5003" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/Api/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/ConsoleClient/ConsoleClient.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/Grains/Grains.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | all 10 | runtime; build; native; contentfiles; analyzers 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/GrainsInterfaces/AuthorizationConfig.cs: -------------------------------------------------------------------------------- 1 | using Orleans.Security.Authorization; 2 | 3 | namespace GrainsInterfaces 4 | { 5 | public static class AuthorizationConfig 6 | { 7 | public static void ConfigureOptions(AuthorizationOptions options) 8 | { 9 | options.AddPolicy("AdminPolicy", policy => policy.RequireRole("Admin")); 10 | options.AddPolicy("ManagerPolicy", policy => policy.RequireRole("Manager")); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/GrainsInterfaces/GrainsInterfaces.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | all 11 | runtime; build; native; contentfiles; analyzers 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/GrainsInterfaces/IGlobalSecretStorageGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans; 3 | using Orleans.Security.Authorization; 4 | 5 | namespace GrainsInterfaces 6 | { 7 | public interface IGlobalSecretStorageGrain : IGrainWithStringKey 8 | { 9 | [Authorize(Roles = "Admin")] 10 | Task TakeUserSecret(string userId); 11 | } 12 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/GrainsInterfaces/IUserGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans; 3 | using Orleans.Security.Authorization; 4 | 5 | namespace GrainsInterfaces 6 | { 7 | public interface IUserGrain : IGrainWithStringKey 8 | { 9 | [Authorize(Policy = "ManagerPolicy")] 10 | Task TakeSecret(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/IdentityServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | IdentityServer4 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Hosting; 4 | 5 | namespace IdentityServer4 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | CreateHostBuilder(args).Build().Run(); 12 | } 13 | 14 | public static IHostBuilder CreateHostBuilder(string[] args) => 15 | Host.CreateDefaultBuilder(args) 16 | .ConfigureWebHostDefaults(webBuilder => 17 | { 18 | webBuilder.UseStartup(); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:32617", 7 | "sslPort": 44370 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "IdentityServer": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Account/ExternalProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class ExternalProvider 8 | { 9 | public string DisplayName { get; set; } 10 | public string AuthenticationScheme { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Account/LoggedOutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LoggedOutViewModel 8 | { 9 | public string PostLogoutRedirectUri { get; set; } 10 | public string ClientName { get; set; } 11 | public string SignOutIframeUrl { get; set; } 12 | 13 | public bool AutomaticRedirectAfterSignOut { get; set; } 14 | 15 | public string LogoutId { get; set; } 16 | public bool TriggerExternalSignout => ExternalAuthenticationScheme != null; 17 | public string ExternalAuthenticationScheme { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Account/LoginInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace 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 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Account/LogoutInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LogoutInputModel 8 | { 9 | public string LogoutId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Account/LogoutViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI 6 | { 7 | public class LogoutViewModel : LogoutInputModel 8 | { 9 | public bool ShowLogoutPrompt { get; set; } = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Account/RedirectViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | 6 | namespace IdentityServer4.Quickstart.UI 7 | { 8 | public class RedirectViewModel 9 | { 10 | public string RedirectUrl { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Consent/ConsentInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace 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 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/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 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/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 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Consent/ProcessConsentResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace 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 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Consent/ScopeViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace 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 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Device/DeviceAuthorizationInputModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI.Device 6 | { 7 | public class DeviceAuthorizationInputModel : ConsentInputModel 8 | { 9 | public string UserCode { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Device/DeviceAuthorizationViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | namespace IdentityServer4.Quickstart.UI.Device 6 | { 7 | public class DeviceAuthorizationViewModel : ConsentViewModel 8 | { 9 | public string UserCode { get; set; } 10 | public bool ConfirmUserCode { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/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 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Quickstart/Home/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. 3 | 4 | 5 | using IdentityServer4.Models; 6 | 7 | namespace IdentityServer4.Quickstart.UI 8 | { 9 | public class ErrorViewModel 10 | { 11 | public ErrorViewModel() 12 | { 13 | } 14 | 15 | public ErrorViewModel(string error) 16 | { 17 | Error = new ErrorMessage { Error = error }; 18 | } 19 | 20 | public ErrorMessage Error { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Views/Account/AccessDenied.cshtml: -------------------------------------------------------------------------------- 1 |  2 |
3 | 6 | 7 |

You do not have access to that resource.

8 |
-------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/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 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Views/Account/Logout.cshtml: -------------------------------------------------------------------------------- 1 | @model LogoutViewModel 2 | 3 |
4 | 7 | 8 |
9 |
10 |

Would you like to logout of IdentityServer?

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

Authentication cookie

4 | 5 |

Claims

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

Properties

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

Clients

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

You are now being returned to the application.

4 |

Once complete, you may close this tab

5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Views/Shared/_ValidationSummary.cshtml: -------------------------------------------------------------------------------- 1 | @if (ViewContext.ModelState.IsValid == false) 2 | { 3 |
4 | Error 5 |
6 |
7 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServer4.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnetcore-3-1/IdentityServer/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnetcore-3-1/IdentityServer/wwwroot/icon.jpg -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnetcore-3-1/IdentityServer/wwwroot/icon.png -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/wwwroot/js/signin-redirect.js: -------------------------------------------------------------------------------- 1 | window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); 2 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/wwwroot/js/signout-redirect.js: -------------------------------------------------------------------------------- 1 | window.addEventListener("load", function () { 2 | var a = document.querySelector("a.PostLogoutRedirectUri"); 3 | if (a) { 4 | window.location = a.href; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnetcore-3-1/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnetcore-3-1/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnetcore-3-1/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Async-Hub/Orleans.Security/4a9fc66d439e16c662036b1f14e60d57e1b059c4/samples/dotnetcore-3-1/IdentityServer/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/SiloHost1/SiloHost1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | latest 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/WebClient/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace WebClient 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/WebClient/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:32627", 7 | "sslPort": 44325 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WebClient": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "https://localhost:5004;http://localhost:5005" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/WebClient/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | 10 | Index 11 | 12 | 13 |
14 | Go to user profile 15 | 16 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/WebClient/Views/Home/UserProfile.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | 10 | UserProfile 11 | 12 | 13 |

UserProfile

14 |

@ViewBag.Response

15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/WebClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | 3 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/WebClient/WebClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/WebClient/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/dotnetcore-3-1/WebClient/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /src/Orleans.Security.Authorization/AllowAnonymousAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Orleans.Security.Authorization 7 | { 8 | /// 9 | /// Specifies that the class or method that this attribute is applied to does not require authorization. 10 | /// 11 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] 12 | public class AllowAnonymousAttribute : Attribute, IAllowAnonymous 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Orleans.Security.Authorization/IAllowAnonymous.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Orleans.Security.Authorization 5 | { 6 | /// 7 | /// Marker interface to enable the . 8 | /// 9 | public interface IAllowAnonymous 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Orleans.Security.Authorization/IAuthorizationEvaluator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Orleans.Security.Authorization 5 | { 6 | /// 7 | /// Determines whether an authorization request was successful or not. 8 | /// 9 | public interface IAuthorizationEvaluator 10 | { 11 | /// 12 | /// Determines whether the authorization result was successful or not. 13 | /// 14 | /// The authorization information. 15 | /// The . 16 | AuthorizationResult Evaluate(AuthorizationHandlerContext context); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Orleans.Security.Authorization/IAuthorizationHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Threading.Tasks; 5 | 6 | namespace Orleans.Security.Authorization 7 | { 8 | /// 9 | /// Classes implementing this interface are able to make a decision if authorization is allowed. 10 | /// 11 | public interface IAuthorizationHandler 12 | { 13 | /// 14 | /// Makes a decision if authorization is allowed. 15 | /// 16 | /// The authorization information. 17 | Task HandleAsync(AuthorizationHandlerContext context); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Orleans.Security.Authorization/IAuthorizationHandlerProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace Orleans.Security.Authorization 8 | { 9 | /// 10 | /// A type which can provide the s for an authorization request. 11 | /// 12 | public interface IAuthorizationHandlerProvider 13 | { 14 | /// 15 | /// Return the handlers that will be called for the authorization request. 16 | /// 17 | /// The . 18 | /// The list of handlers. 19 | Task> GetHandlersAsync(AuthorizationHandlerContext context); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Orleans.Security.Authorization/IAuthorizationRequirement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Orleans.Security.Authorization 5 | { 6 | /// 7 | /// Represents an authorization requirement. 8 | /// 9 | public interface IAuthorizationRequirement 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Orleans.Security.Authorization/OperationAuthorizationRequirement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Orleans.Security.Authorization.Infrastructure 5 | { 6 | /// 7 | /// A helper class to provide a useful which 8 | /// contains a name. 9 | /// 10 | public class OperationAuthorizationRequirement : IAuthorizationRequirement 11 | { 12 | /// 13 | /// The name of this instance of . 14 | /// 15 | public string Name { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Orleans.Security.Authorization/Orleans.Security.Authorization.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Microsoft Orleans authorization library. 5 | netstandard2.0 6 | $(NoWarn);CS1591 7 | true 8 | orleans;authorization 9 | false 10 | false 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Orleans.Security.Client/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | [assembly: InternalsVisibleTo("Orleans.Security.IntegrationTests")] 5 | 6 | [assembly: AssemblyVersion("1.3.0.0")] 7 | [assembly: AssemblyFileVersion("1.3.0.0")] 8 | [assembly: AssemblyInformationalVersion("1.3.0.0")] -------------------------------------------------------------------------------- /src/Orleans.Security.Client/Orleans.Security.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | AsyncHub 6 | https://orlsec.asynchub.org/ 7 | https://github.com/Async-Hub/Orleans.Security 8 | false 9 | false 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Orleans.Security.Clustering/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | [assembly: InternalsVisibleTo("Orleans.Security.IntegrationTests")] 5 | 6 | [assembly: AssemblyVersion("1.3.0.0")] 7 | [assembly: AssemblyFileVersion("1.3.0.0")] 8 | [assembly: AssemblyInformationalVersion("1.3.0.0")] -------------------------------------------------------------------------------- /src/Orleans.Security.Clustering/Orleans.Security.Clustering.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | AsyncHub 6 | AsyncHub 7 | https://orlsec.asynchub.org/ 8 | https://github.com/Async-Hub/Orleans.Security 9 | false 10 | false 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Orleans.Security.Interoperability/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | [assembly: InternalsVisibleTo("Orleans.Security.Client")] 5 | [assembly: InternalsVisibleTo("Orleans.Security.Clustering")] 6 | [assembly: InternalsVisibleTo("Orleans.Security.IntegrationTests.TokenVerification")] 7 | 8 | [assembly: AssemblyVersion("1.3.0.0")] 9 | [assembly: AssemblyFileVersion("1.3.0.0")] 10 | [assembly: AssemblyInformationalVersion("1.3.0.0")] -------------------------------------------------------------------------------- /src/Orleans.Security.Interoperability/GrainWithClaimsPrincipal.cs: -------------------------------------------------------------------------------- 1 | using System.Security.Claims; 2 | using System.Threading.Tasks; 3 | using Orleans.Runtime; 4 | 5 | namespace Orleans.Security 6 | { 7 | public class GrainWithClaimsPrincipal : Grain, IIncomingGrainCallFilter 8 | { 9 | protected ClaimsPrincipal User; 10 | 11 | public async Task Invoke(IIncomingGrainCallContext context) 12 | { 13 | User = (ClaimsPrincipal)RequestContext.Get(ConfigurationKeys.ClaimsPrincipalKey); 14 | 15 | await context.Invoke(); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Orleans.Security/AccessToken/AccessTokenType.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.AccessToken 2 | 3 | type AccessTokenType = 4 | | Jwt = 0 5 | | Reference = 1 6 | 7 | //namespace Orleans.Security.AccessToken 8 | //{ 9 | // public enum AccessTokenType 10 | // { 11 | // Jwt = 0, 12 | // Reference = 1 13 | // } 14 | //} -------------------------------------------------------------------------------- /src/Orleans.Security/AccessToken/AccessTokenVerifierOptions.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.AccessToken 2 | 3 | type AccessTokenVerifierOptions() = 4 | member val AllowOfflineValidation = false with get,set 5 | member val CacheEntryExpirationTime = 15 with get, set 6 | member val InMemoryCacheEnabled = false with get,set 7 | 8 | //namespace Orleans.Security.AccessToken 9 | //{ 10 | // public class AccessTokenVerifierOptions 11 | // { 12 | // public bool AllowOfflineValidation { get; set; } 13 | 14 | // /// 15 | // /// Cache entry expiration time. The default value is 15 second. 16 | // /// 17 | // public int CacheEntryExpirationTime { get; set; } = 15; 18 | 19 | // public bool DisableCertificateValidation { get; set; } 20 | 21 | // public bool InMemoryCacheEnabled { get; set; } 22 | // } 23 | //} -------------------------------------------------------------------------------- /src/Orleans.Security/AccessToken/IAccessTokenIntrospectionService.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.AccessToken 2 | 3 | open System.Threading.Tasks 4 | 5 | type internal IAccessTokenIntrospectionService = 6 | abstract IntrospectTokenAsync: accessToken:string 7 | -> allowOfflineValidation:bool -> Task 8 | 9 | //using System.Threading.Tasks; 10 | 11 | //namespace Orleans.Security.AccessToken 12 | //{ 13 | // internal interface IAccessTokenIntrospectionService 14 | // { 15 | // Task IntrospectTokenAsync(string accessToken, 16 | // bool allowOfflineValidation = false); 17 | // } 18 | //} -------------------------------------------------------------------------------- /src/Orleans.Security/AccessToken/IAccessTokenVerifier.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.AccessToken 2 | 3 | open System.Threading.Tasks 4 | 5 | type IAccessTokenVerifier = 6 | abstract Verify: accessToken : string -> Task 7 | 8 | //using System.Threading.Tasks; 9 | 10 | //namespace Orleans.Security.AccessToken 11 | //{ 12 | // public interface IAccessTokenVerifier 13 | // { 14 | // Task Verify(string accessToken); 15 | // } 16 | //} -------------------------------------------------------------------------------- /src/Orleans.Security/AccessToken/InvalidAccessTokenException.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.AccessToken 2 | 3 | open System 4 | 5 | type InvalidAccessTokenException= 6 | inherit Exception 7 | new () = {} 8 | new (message) = {inherit Exception(message);} 9 | new (message : string, innerException) = {inherit Exception(message,innerException);} 10 | 11 | //using System; 12 | 13 | //// ReSharper disable UnusedMember.Global 14 | 15 | //namespace Orleans.Security.AccessToken 16 | //{ 17 | // public class InvalidAccessTokenException : Exception 18 | // { 19 | // public InvalidAccessTokenException() 20 | // { 21 | // } 22 | 23 | // public InvalidAccessTokenException(string message) : base(message) 24 | // { 25 | // } 26 | 27 | // public InvalidAccessTokenException(string message, Exception innerException) : 28 | // base(message, innerException) 29 | // { 30 | // } 31 | // } 32 | //} -------------------------------------------------------------------------------- /src/Orleans.Security/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.FSharp 2 | 3 | open System.Reflection 4 | open System.Runtime.CompilerServices 5 | 6 | [] 7 | [] 8 | [] 9 | [] 10 | //TODO: Check why we need this. 11 | [] 12 | [] 13 | [] 14 | do() -------------------------------------------------------------------------------- /src/Orleans.Security/Authorization/IAuthorizationExecutor.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.Authorization 2 | 3 | open System.Collections.Generic 4 | open System.Security.Claims 5 | open System.Threading.Tasks 6 | 7 | type internal IAuthorizationExecutor = 8 | abstract member AuthorizeAsync : 9 | claims: IEnumerable * 10 | grainInterfaceAuthorizeData: IEnumerable * 11 | grainMethodAuthorizeData: IEnumerable -> Task 12 | 13 | //using System.Collections.Generic; 14 | //using System.Security.Claims; 15 | //using System.Threading.Tasks; 16 | 17 | //namespace Orleans.Security.Authorization 18 | //{ 19 | // public interface IAuthorizationExecutor 20 | // { 21 | // Task AuthorizeAsync(IEnumerable claims, IEnumerable grainInterfaceAuthorizeData, 22 | // IEnumerable grainMethodAuthorizeData); 23 | // } 24 | //} 25 | -------------------------------------------------------------------------------- /src/Orleans.Security/Caching/IAccessTokenCache.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.Caching 2 | 3 | open Microsoft.Extensions.Caching.Memory 4 | 5 | type IAccessTokenCache = 6 | abstract Current : IMemoryCache with get 7 | 8 | //using Microsoft.Extensions.Caching.Memory; 9 | 10 | //namespace Orleans.Security.Caching 11 | //{ 12 | // internal interface IAccessTokenCache 13 | // { 14 | // IMemoryCache Current { get; } 15 | // } 16 | //} -------------------------------------------------------------------------------- /src/Orleans.Security/ConfigurationKeys.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security 2 | 3 | module ConfigurationKeys = 4 | let OAuth2EndpointInfoKey = "OAuth2EndpointInfoKey" 5 | let AccessTokenKey = "AccessTokenKey" 6 | let ClaimsPrincipalKey = "ClaimsPrincipalKey" 7 | 8 | //namespace Orleans.Security 9 | //{ 10 | // public static class ConfigurationKeys 11 | // { 12 | // public static string OAuth2EndpointInfoKey => "OAuth2EndpointInfoKey"; 13 | 14 | // public static string AccessTokenKey => "AccessTokenKey"; 15 | 16 | // public static string ClaimsPrincipalKey => "ClaimsPrincipalKey"; 17 | // } 18 | //} -------------------------------------------------------------------------------- /src/Orleans.Security/DiscoveryDocumentShortInfo.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.AccessToken 2 | 3 | open IdentityModel.Jwk 4 | open System.Collections.Generic 5 | 6 | [] 7 | type DiscoveryDocumentShortInfo() = 8 | member val IntrospectionEndpoint : string = null with get, set 9 | 10 | member val Issuer : string = null with get, set 11 | 12 | member val Keys : IList = null with get,set 13 | 14 | member val TokenEndpoint : string = null with get,set 15 | 16 | //using System.Collections.Generic; 17 | //using IdentityModel.Jwk; 18 | 19 | //namespace Orleans.Security.AccessToken 20 | //{ 21 | // public class DiscoveryDocumentShortInfo 22 | // { 23 | // public string IntrospectionEndpoint { get; set; } 24 | 25 | // public IList Keys { get; set; } 26 | 27 | // public string Issuer { get; set; } 28 | 29 | // public string TokenEndpoint { get; set; } 30 | // } 31 | //} 32 | -------------------------------------------------------------------------------- /src/Orleans.Security/Extensions.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security 2 | 3 | open System.Threading.Tasks 4 | 5 | module Extensions = 6 | let (|?) lhs rhs = (if isNull lhs then rhs else lhs) 7 | 8 | type Async with 9 | static member AwaitTaskAndTryToUnwrapException (task: Task) = 10 | async { 11 | try 12 | do! task |> Async.AwaitTask 13 | with 14 | | :? System.AggregateException as ex -> 15 | if (not (isNull ex.InnerExceptions)) && ex.InnerExceptions.Count = 1 then 16 | raise ex.InnerException 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/Orleans.Security/GlobalSettings.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security 2 | 3 | type SecurityOptions()= 4 | member val RequireHttps = true with get, set -------------------------------------------------------------------------------- /src/Orleans.Security/GrainWithClaimsPrincipal.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security 2 | 3 | //open System.Threading.Tasks 4 | //open Orleans.Runtime 5 | //open System.Security.Claims 6 | //open Orleans 7 | 8 | //// TODO: Activation access violation. A non-activation thread attempted to access activation services 9 | //type GrainWithClaimsPrincipal()= 10 | // [] val mutable User : ClaimsPrincipal 11 | // inherit Orleans.Grain 12 | // interface IIncomingGrainCallFilter with 13 | // member this.Invoke(context: IIncomingGrainCallContext) = 14 | // async { 15 | // this.User <- RequestContext.Get(ConfigurationKeys.ClaimsPrincipalKey) :?> ClaimsPrincipal 16 | // do! context.Invoke() |> Async.AwaitTask 17 | // } |> Async.StartAsTask :> Task -------------------------------------------------------------------------------- /src/Orleans.Security/IAccessTokenProvider.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security 2 | 3 | open System.Threading.Tasks 4 | 5 | type IAccessTokenProvider = 6 | abstract member RetrieveTokenAsync : unit -> Task 7 | 8 | //using System.Threading.Tasks; 9 | 10 | //namespace Orleans.Security 11 | //{ 12 | // public interface IAccessTokenProvider 13 | // { 14 | // Task RetrieveTokenAsync(); 15 | // } 16 | //} -------------------------------------------------------------------------------- /src/Orleans.Security/NotAuthorizedException.fs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security 2 | 3 | open System 4 | 5 | [] 6 | type NotAuthorizedException = 7 | inherit Exception 8 | 9 | new() = {inherit Exception();} 10 | new(message) = { inherit Exception(message); } 11 | new(message, innerException : Exception) = {inherit Exception(message, innerException);} 12 | 13 | //using System; 14 | 15 | //namespace Orleans.Security 16 | //{ 17 | // [Serializable] 18 | // public class NotAuthorizedException : Exception 19 | // { 20 | // // ReSharper disable once UnusedMember.Global 21 | // public NotAuthorizedException() 22 | // { 23 | // } 24 | 25 | // public NotAuthorizedException(string message) : base(message) 26 | // { 27 | // } 28 | 29 | // public NotAuthorizedException(string message, Exception innerException) : 30 | // base(message, innerException) 31 | // { 32 | // } 33 | // } 34 | //} -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Functional/Assembly.fs: -------------------------------------------------------------------------------- 1 | module Assembly 2 | 3 | open Xunit 4 | 5 | [] 6 | do() -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Functional/Initialization/GlobalConfig.fs: -------------------------------------------------------------------------------- 1 | module GlobalConfig 2 | 3 | open Orleans.Security 4 | 5 | let identityServer4Url = "http://localhost:5001" 6 | let identityServer4Info = IdentityServer4Info(identityServer4Url, 7 | "Orleans", "@3x3g*RLez$TNU!_7!QW", "Orleans") 8 | [] 9 | let WebClient1 = "WebClient1" 10 | [] 11 | let WebClient2 = "WebClient2" 12 | -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Functional/Initialization/IdSResources.fs: -------------------------------------------------------------------------------- 1 | module IdSResources 2 | 3 | open IdentityModel 4 | open IdentityServer4.Models 5 | open System.Collections.Generic 6 | 7 | let getApiResources() = 8 | let api1 = ApiResource "Api1" 9 | api1.UserClaims.Add JwtClaimTypes.Email 10 | api1.UserClaims.Add JwtClaimTypes.Role 11 | 12 | Secret(HashExtensions.Sha256 "Secret") |> api1.ApiSecrets.Add 13 | 14 | let orleans = ApiResource("Orleans"); 15 | Secret(HashExtensions.Sha256 "@3x3g*RLez$TNU!_7!QW") |> orleans.ApiSecrets.Add 16 | 17 | [api1; orleans] |> ResizeArray 18 | 19 | let getIdentityResources() = 20 | let resources = List() 21 | 22 | resources.Add(IdentityResources.Email()) 23 | resources.Add(IdentityResources.Profile()) 24 | resources.Add(IdentityResources.OpenId()) 25 | 26 | resources 27 | -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Functional/Program.fs: -------------------------------------------------------------------------------- 1 | module Program = let [] main _ = 0 2 | -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Functional/TestsNUnit.fs: -------------------------------------------------------------------------------- 1 | module TestsNUnit 2 | 3 | open NUnit.Framework 4 | open Orleans.Security.AccessToken 5 | 6 | [] 7 | let Setup () = 8 | () 9 | 10 | [] 11 | let Test () = 12 | Assert.Pass() 13 | -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ClaimsBasedAuthorization/CityClaim.cs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.IntegrationTests.Grains.ClaimsBasedAuthorization 2 | { 3 | public static class CityClaim 4 | { 5 | public const string Name = "City"; 6 | } 7 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ClaimsBasedAuthorization/ClaimGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Orleans.Security.IntegrationTests.Grains.ClaimsBasedAuthorization 4 | { 5 | public class ClaimGrain : Grain, IClaimGrain 6 | { 7 | public Task DoSomething(string someInput) 8 | { 9 | return Task.FromResult(someInput); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ClaimsBasedAuthorization/IClaimGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans.Security.Authorization; 3 | 4 | namespace Orleans.Security.IntegrationTests.Grains.ClaimsBasedAuthorization 5 | { 6 | public interface IClaimGrain : IGrainWithStringKey 7 | { 8 | [Authorize(Policy = "NewYorkCityOnly")] 9 | Task DoSomething(string someInput); 10 | } 11 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/IGlobalSecretStorageGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans.Security.Authorization; 3 | 4 | namespace Orleans.Security.IntegrationTests.Grains 5 | { 6 | public interface IGlobalSecretStorageGrain : IGrainWithStringKey 7 | { 8 | [Authorize(Roles = "Admin")] 9 | Task TakeUserSecret(string userId); 10 | } 11 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/Orleans.Security.IntegrationTests.Grains.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | all 10 | runtime; build; native; contentfiles; analyzers 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/PolicyBasedAuthorization/IPolicyGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans.Security.Authorization; 3 | 4 | namespace Orleans.Security.IntegrationTests.Grains.PolicyBasedAuthorization 5 | { 6 | public interface IPolicyGrain : IGrainWithStringKey 7 | { 8 | [Authorize(Policy = "ManagerPolicy")] 9 | Task GetWithMangerPolicy(string secret); 10 | } 11 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/PolicyBasedAuthorization/PolicyGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Orleans.Security.IntegrationTests.Grains.PolicyBasedAuthorization 4 | { 5 | public class PolicyGrain : Grain, IPolicyGrain 6 | { 7 | public Task GetWithMangerPolicy(string secret) 8 | { 9 | return Task.FromResult(secret); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ResourceBasedAuthorization/DocModifyAuthorizationHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans.Security.Authorization; 3 | 4 | namespace Orleans.Security.IntegrationTests.Grains.ResourceBasedAuthorization 5 | { 6 | public sealed class SameAuthorRequirement : IAuthorizationRequirement { } 7 | 8 | public class DocModifyAuthorizationHandler : AuthorizationHandler 9 | { 10 | protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, 11 | SameAuthorRequirement requirement, Document resource) 12 | { 13 | if (context.User.Identity?.Name == resource.Author) 14 | { 15 | context.Succeed(requirement); 16 | } 17 | 18 | return Task.CompletedTask; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ResourceBasedAuthorization/DocRegistryAccessClaim.cs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.IntegrationTests.Grains.ResourceBasedAuthorization 2 | { 3 | public static class DocRegistryAccessClaim 4 | { 5 | public const string Name = "DocRegistryAccess"; 6 | 7 | public const string Value = "Allowed"; 8 | } 9 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ResourceBasedAuthorization/DocRegistryAccessRequirement.cs: -------------------------------------------------------------------------------- 1 | using Orleans.Security.Authorization; 2 | 3 | namespace Orleans.Security.IntegrationTests.Grains.ResourceBasedAuthorization 4 | { 5 | public sealed class DocRegistryAccessRequirement : IAuthorizationRequirement 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ResourceBasedAuthorization/Document.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Orleans.Security.IntegrationTests.Grains.ResourceBasedAuthorization 4 | { 5 | [Serializable] 6 | public class Document 7 | { 8 | public string Name { get; set; } 9 | 10 | public string Author { get; set; } 11 | 12 | public string Content { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ResourceBasedAuthorization/DocumentsRegistry.cs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.IntegrationTests.Grains.ResourceBasedAuthorization 2 | { 3 | public static class DocumentsRegistry 4 | { 5 | public const string Default = "DocRegistryDefault"; 6 | } 7 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ResourceBasedAuthorization/IDocumentsRegistryGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans.Security.Authorization; 3 | 4 | namespace Orleans.Security.IntegrationTests.Grains.ResourceBasedAuthorization 5 | { 6 | [Authorize(Policy = "DocRegistryAccess")] 7 | public interface IDocumentsRegistryGrain : IGrainWithStringKey 8 | { 9 | Task Add(Document doc); 10 | 11 | Task Modify(string docName, string newContent); 12 | 13 | Task Take(string docName); 14 | } 15 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ResourceBasedAuthorization/IUserGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans.Security.Authorization; 3 | 4 | namespace Orleans.Security.IntegrationTests.Grains.ResourceBasedAuthorization 5 | { 6 | [Authorize] 7 | public interface IUserGrain : IGrainWithStringKey 8 | { 9 | Task GetDocumentContent(string docName); 10 | 11 | Task ModifyDocumentContent(string docName, string newContent); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/ResourceBasedAuthorization/UserGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Orleans.Security.IntegrationTests.Grains.ResourceBasedAuthorization 4 | { 5 | public class UserGrain : Grain, IUserGrain 6 | { 7 | public async Task GetDocumentContent(string docName) 8 | { 9 | var grain = GrainFactory.GetGrain(DocumentsRegistry.Default); 10 | var doc = await grain.Take(docName); 11 | 12 | return doc.Content; 13 | } 14 | 15 | public async Task ModifyDocumentContent(string docName, string newContent) 16 | { 17 | var grain = GrainFactory.GetGrain(DocumentsRegistry.Default); 18 | 19 | return await grain.Modify(docName, newContent); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/RoleBasedAuthorization/IManagerGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans.Security.Authorization; 3 | 4 | namespace Orleans.Security.IntegrationTests.Grains.RoleBasedAuthorization 5 | { 6 | public interface IManagerGrain : IGrainWithStringKey 7 | { 8 | [Authorize(Roles = "Developer, Manager")] 9 | Task GetWithCommaSeparatedRoles(string secret); 10 | 11 | [Authorize(Roles = "Developer")] 12 | [Authorize(Roles = "Manager")] 13 | Task GetWithMultipleRoleAttributes(string secret); 14 | } 15 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/RoleBasedAuthorization/ManagerGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Orleans.Security.IntegrationTests.Grains.RoleBasedAuthorization 4 | { 5 | public class ManagerGrain : Grain, IManagerGrain 6 | { 7 | public Task GetWithCommaSeparatedRoles(string secret) 8 | { 9 | return Task.FromResult(secret); 10 | } 11 | 12 | public Task GetWithMultipleRoleAttributes(string secret) 13 | { 14 | return Task.FromResult(secret); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/SimpleAuthorization/ISimpleGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans.Security.Authorization; 3 | 4 | namespace Orleans.Security.IntegrationTests.Grains.SimpleAuthorization 5 | { 6 | [Authorize] 7 | public interface ISimpleGrain : IGrainWithGuidKey 8 | { 9 | [AllowAnonymous] 10 | Task GetWithAnonymousUser(string secret); 11 | 12 | Task GetWithAuthenticatedUser(string secret); 13 | 14 | Task GetValue(); 15 | } 16 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.Grains/SimpleAuthorization/SimpleGrain.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Orleans.Security.IntegrationTests.Grains.SimpleAuthorization 4 | { 5 | public class SimpleGrain : Grain, ISimpleGrain 6 | { 7 | public Task GetWithAnonymousUser(string secret) 8 | { 9 | return Task.FromResult(secret); 10 | } 11 | 12 | public Task GetWithAuthenticatedUser(string secret) 13 | { 14 | return Task.FromResult(secret); 15 | } 16 | 17 | public Task GetValue() 18 | { 19 | return Task.FromResult("Some protected string."); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests.TokenVerification/TokenVerificationTests.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans.Security.AccessToken; 3 | using Xunit; 4 | 5 | namespace Orleans.Security.IntegrationTests.TokenVerification 6 | { 7 | public class TokenVerificationTests : TestBase 8 | { 9 | [Theory] 10 | [InlineData("WebClient", "Secret", "Api1")] 11 | public async Task VerifyAccessToken_WithCorrectScope_ShouldBeSuccessful(string clientId, 12 | string clientSecret, string scope) 13 | { 14 | // Arrange 15 | var accessToken = await RequestClientCredentialsTokenAsync(clientId, clientSecret, scope); 16 | 17 | // Act 18 | var claims = JwtSecurityTokenVerifier.Verify(accessToken, scope, DiscoveryDocument); 19 | 20 | // Assert 21 | Assert.True(claims != null); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests/Configuration/EmailVerifiedRequirement.cs: -------------------------------------------------------------------------------- 1 | using Orleans.Security.Authorization; 2 | 3 | namespace Orleans.Security.IntegrationTests.Configuration 4 | { 5 | public class EmailVerifiedRequirement : IAuthorizationRequirement 6 | { 7 | public bool IsEmailVerified { get; } 8 | 9 | public EmailVerifiedRequirement(bool isEmailVerified) 10 | { 11 | IsEmailVerified = isEmailVerified; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests/Configuration/FakeAccessTokenProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Orleans.Security.Client; 3 | 4 | namespace Orleans.Security.IntegrationTests.Configuration 5 | { 6 | internal class FakeAccessTokenProvider : IAccessTokenProvider 7 | { 8 | public Task RetrieveTokenAsync() 9 | { 10 | return Task.FromResult("Fake Token"); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests/Configuration/GenderRequirement.cs: -------------------------------------------------------------------------------- 1 | using Orleans.Security.Authorization; 2 | 3 | namespace Orleans.Security.IntegrationTests.Configuration 4 | { 5 | public class GenderRequirement : IAuthorizationRequirement 6 | { 7 | public string Gender { get; } 8 | 9 | public GenderRequirement(string gender) 10 | { 11 | Gender = gender; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests/Configuration/LoggedInUser.cs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.IntegrationTests.Configuration 2 | { 3 | internal enum LoggedInUser 4 | { 5 | BobSmith = 0, 6 | AliceSmith = 1 7 | } 8 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests/Configuration/RoleIsPresentRequirement.cs: -------------------------------------------------------------------------------- 1 | using Orleans.Security.Authorization; 2 | 3 | namespace Orleans.Security.IntegrationTests.Configuration 4 | { 5 | public class RoleIsPresentRequirement : IAuthorizationRequirement 6 | { 7 | public string Role { get; } 8 | 9 | public RoleIsPresentRequirement(string role) 10 | { 11 | Role = role; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests/Configuration/TestClusterOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Orleans.Security.IntegrationTests.Configuration 2 | { 3 | internal static class TestClusterOptions 4 | { 5 | public const string ClusterId = nameof(IntegrationTests); 6 | 7 | public const string ServiceId = "Service_1"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/Orleans.Security.IntegrationTests/SetUpTestEnvieronment.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NUnit.Framework; 3 | using Orleans.Security.IntegrationTests.Configuration; 4 | 5 | namespace Orleans.Security.IntegrationTests 6 | { 7 | [SetUpFixture] 8 | public class SetUpTestEnvironment 9 | { 10 | [OneTimeSetUp] 11 | public async Task RunBeforeAnyTests() 12 | { 13 | // Start test cluster. 14 | await TestClusterBuilder.StartSilo(); 15 | 16 | // Start test client. 17 | await TestClientBuilder.StartClient(); 18 | } 19 | 20 | [OneTimeTearDown] 21 | public void RunAfterAnyTests() 22 | { 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/Orleans.Security.Tests/AuthorizationAdmissionTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NSubstitute; 3 | using Xunit; 4 | using System.Reflection; 5 | using System.Reflection.Emit; 6 | using Orleans.Security.Authorization; 7 | 8 | namespace Orleans.Security.Tests 9 | { 10 | public class AuthorizationAdmissionTests 11 | { 12 | [Fact] 13 | public void WhenAllowAnonymousAttributeAppliedToTheGrainMethodAuthorizationShouldBeSkipped() 14 | { 15 | var grainCallContext = Substitute.For(); 16 | var methodInfo = Substitute.For(); 17 | grainCallContext.InterfaceMethod.Returns(methodInfo); 18 | 19 | grainCallContext.InterfaceMethod 20 | .GetCustomAttributes() 21 | .Returns(new[] {new AllowAnonymousAttribute()}); 22 | 23 | Assert.False(AuthorizationAdmission.IsRequired(grainCallContext)); 24 | } 25 | } 26 | } 27 | --------------------------------------------------------------------------------