- /// public void ConfigureServices(IServiceCollection services)
- /// {
- /// services.AddRavenDbAsyncSession(() => myRavenDocStore);
- /// }
- ///
- ///
- /// public void ConfigureServices(IServiceCollection services)
- /// {
- /// services.AddRavenDbAsyncSession(() => myRavenDocStore);
- /// }
- ///
- ///
- /// public void ConfigureServices(IServiceCollection services)
- /// {
- /// services.AddRavenDbAsyncSession();
- /// }
- ///
- ///
+ Request ID: @Model.RequestId
+
+ Swapping to the Development environment displays detailed information about the error that occurred. +
++ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +
diff --git a/Sample/Pages/Error.cshtml.cs b/Sample/Pages/Error.cshtml.cs new file mode 100644 index 0000000..cf499f2 --- /dev/null +++ b/Sample/Pages/Error.cshtml.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Sample.Pages +{ + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public class ErrorModel : PageModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + public void OnGet() + { + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; + } + } +} diff --git a/Sample/Pages/Index.cshtml b/Sample/Pages/Index.cshtml new file mode 100644 index 0000000..b67a472 --- /dev/null +++ b/Sample/Pages/Index.cshtml @@ -0,0 +1,21 @@ +@page +@model IndexModel +@{ + ViewData["Title"] = "Home page"; +} +@inject SignInManagerHi, @User.Identity.Name. You're currently signed in. 😎
++ Your user is saved in Raven. View it. +
+ } + else + { +You're not signed in. Click register or login to try out Raven.Identity.
+ } +Use this page to detail your site's privacy policy.
diff --git a/Sample/Pages/Privacy.cshtml.cs b/Sample/Pages/Privacy.cshtml.cs new file mode 100644 index 0000000..6642e75 --- /dev/null +++ b/Sample/Pages/Privacy.cshtml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Sample.Pages +{ + public class PrivacyModel : PageModel + { + public void OnGet() + { + } + } +} \ No newline at end of file diff --git a/Sample/Pages/Shared/_CookieConsentPartial.cshtml b/Sample/Pages/Shared/_CookieConsentPartial.cshtml new file mode 100644 index 0000000..7df65c4 --- /dev/null +++ b/Sample/Pages/Shared/_CookieConsentPartial.cshtml @@ -0,0 +1,25 @@ +@using Microsoft.AspNetCore.Http.Features + +@{ + var consentFeature = Context.Features.GetYou do not have access to this resource.
-- Thank you for confirming your email. -
-- You've successfully authenticated with @ViewData["LoginProvider"]. - Please enter an email address for this site below and click the Register button to finish - logging in. -
- -- Please check your email to reset your password. -
diff --git a/Sample/Views/Account/Lockout.cshtml b/Sample/Views/Account/Lockout.cshtml deleted file mode 100644 index f573a1f..0000000 --- a/Sample/Views/Account/Lockout.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Locked out"; -} - -This account has been locked out, please try again later.
-- There are no external authentication services configured. See this article - for details on setting up this ASP.NET application to support logging in via external services. -
-Your login is protected with an authenticator app. Enter your authenticator code below.
-- Don't have access to your authenticator device? You can - log in with a recovery code. -
- -@section Scripts { - @await Html.PartialAsync("_ValidationScriptsPartial") -} \ No newline at end of file diff --git a/Sample/Views/Account/LoginWithRecoveryCode.cshtml b/Sample/Views/Account/LoginWithRecoveryCode.cshtml deleted file mode 100644 index e2eb4c5..0000000 --- a/Sample/Views/Account/LoginWithRecoveryCode.cshtml +++ /dev/null @@ -1,28 +0,0 @@ -@model LoginWithRecoveryCodeViewModel -@{ - ViewData["Title"] = "Recovery code verification"; -} - -- You have requested to login with a recovery code. This login will not be remembered until you provide - an authenticator app code at login or disable 2FA and login again. -
-- Your password has been reset. Please click here to log in. -
diff --git a/Sample/Views/Account/SignedOut.cshtml b/Sample/Views/Account/SignedOut.cshtml deleted file mode 100644 index c7fb988..0000000 --- a/Sample/Views/Account/SignedOut.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Signed out"; -} - -- You have successfully signed out. -
diff --git a/Sample/Views/Home/About.cshtml b/Sample/Views/Home/About.cshtml deleted file mode 100644 index 3674e37..0000000 --- a/Sample/Views/Home/About.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - ViewData["Title"] = "About"; -} -Use this area to provide additional information.
diff --git a/Sample/Views/Home/Auth.cshtml b/Sample/Views/Home/Auth.cshtml deleted file mode 100644 index 0ae620e..0000000 --- a/Sample/Views/Home/Auth.cshtml +++ /dev/null @@ -1 +0,0 @@ -- - This action only disables 2FA. -
-- Disabling 2FA does not change the keys used in authenticator apps. If you wish to change the key - used in an authenticator app you should reset your - authenticator keys. -
-To use an authenticator app go through the following steps:
-- Download a two-factor authenticator app like Microsoft Authenticator for - Windows Phone, - Android and - iOS or - Google Authenticator for - Android and - iOS. -
-Scan the QR Code or enter this key @Model.SharedKey into your two factor authenticator app. Spaces and casing do not matter.
-- Once you have scanned the QR code or input the key above, your two factor authentication app will provide you - with a unique code. Enter the code in the confirmation box below. -
-| @login.LoginProvider | -- @if (Model.ShowRemoveButton) - { - - } - else - { - @: - } - | -
- - Put these codes in a safe place. -
-- If you lose your device and don't have the recovery codes you will lose access to your account. -
-@Model.RecoveryCodes[row]@Model.RecoveryCodes[row + 1]- - If you reset your authenticator key your authenticator app will not work until you reconfigure it. -
-- This process disables 2FA until you verify your authenticator app and will also reset your 2FA recovery codes. - If you do not complete your authenticator app configuration you may lose access to your account. -
-- You do not have a local username/password for this site. Add a local - account so you can log in without an external login. -
-You must generate a new set of recovery codes before you can log in with a recovery code.
-You can generate a new set of recovery codes.
-You should generate a new set of recovery codes.
-
- Request ID: @Model.RequestId
-
- Swapping to Development environment will display more detailed information about the error that occurred. -
-- Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. -
diff --git a/Sample/Views/Shared/_Layout.cshtml b/Sample/Views/Shared/_Layout.cshtml deleted file mode 100644 index ad01061..0000000 --- a/Sample/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - -`s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: $paragraph-margin-bottom;\n}\n\n// Abbreviations\n//\n// 1. Remove the bottom border in Firefox 39-.\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Duplicate behavior to the data-* attribute for our tooltip plugin\n\nabbr[title],\nabbr[data-original-title] { // 4\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n border-bottom: 0; // 1\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic; // Add the correct font style in Android 4.3-\n}\n\n// stylelint-disable font-weight-notation\nb,\nstrong {\n font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n// stylelint-enable font-weight-notation\n\nsmall {\n font-size: 80%; // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n//\n// Links\n//\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n background-color: transparent; // Remove the gray background on active links in IE 10.\n -webkit-text-decoration-skip: objects; // Remove gaps in links underline in iOS 8+ and Safari 8+.\n\n @include hover {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href)\n// which have not been made explicitly keyboard-focusable (without tabindex).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n\n @include hover-focus {\n color: inherit;\n text-decoration: none;\n }\n\n &:focus {\n outline: 0;\n }\n}\n\n\n//\n// Code\n//\n\npre,\ncode,\nkbd,\nsamp {\n font-family: $font-family-monospace;\n font-size: 1em; // Correct the odd `em` font sizing in all browsers.\n}\n\npre {\n // Remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `rem`s\n margin-bottom: 1rem;\n // Don't allow content to break outside\n overflow: auto;\n // We have @viewport set which causes scrollbars to overlap content in IE11 and Edge, so\n // we force a non-overlapping, non-auto-hiding scrollbar to counteract.\n -ms-overflow-style: scrollbar;\n}\n\n\n//\n// Figures\n//\n\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1rem;\n}\n\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // Remove the border on images inside links in IE 10-.\n}\n\nsvg {\n // Workaround for the SVG overflow bug in IE10/11 is still required.\n // See https://github.com/twbs/bootstrap/issues/26878\n overflow: hidden;\n vertical-align: middle;\n}\n\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: $table-cell-padding;\n padding-bottom: $table-cell-padding;\n color: $table-caption-color;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n // Matches default `
`s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: $paragraph-margin-bottom;\n}\n\n// Abbreviations\n//\n// 1. Remove the bottom border in Firefox 39-.\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Duplicate behavior to the data-* attribute for our tooltip plugin\n\nabbr[title],\nabbr[data-original-title] { // 4\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n border-bottom: 0; // 1\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic; // Add the correct font style in Android 4.3-\n}\n\n// stylelint-disable font-weight-notation\nb,\nstrong {\n font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n// stylelint-enable font-weight-notation\n\nsmall {\n font-size: 80%; // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n//\n// Links\n//\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n background-color: transparent; // Remove the gray background on active links in IE 10.\n -webkit-text-decoration-skip: objects; // Remove gaps in links underline in iOS 8+ and Safari 8+.\n\n @include hover {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href)\n// which have not been made explicitly keyboard-focusable (without tabindex).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n\n @include hover-focus {\n color: inherit;\n text-decoration: none;\n }\n\n &:focus {\n outline: 0;\n }\n}\n\n\n//\n// Code\n//\n\npre,\ncode,\nkbd,\nsamp {\n font-family: $font-family-monospace;\n font-size: 1em; // Correct the odd `em` font sizing in all browsers.\n}\n\npre {\n // Remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `rem`s\n margin-bottom: 1rem;\n // Don't allow content to break outside\n overflow: auto;\n // We have @viewport set which causes scrollbars to overlap content in IE11 and Edge, so\n // we force a non-overlapping, non-auto-hiding scrollbar to counteract.\n -ms-overflow-style: scrollbar;\n}\n\n\n//\n// Figures\n//\n\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1rem;\n}\n\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // Remove the border on images inside links in IE 10-.\n}\n\nsvg {\n // Workaround for the SVG overflow bug in IE10/11 is still required.\n // See https://github.com/twbs/bootstrap/issues/26878\n overflow: hidden;\n vertical-align: middle;\n}\n\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: $table-cell-padding;\n padding-bottom: $table-cell-padding;\n color: $table-caption-color;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n // Matches default `