Repository: anjoy8/Blog.IdentityServer Branch: master Commit: 2ca932e9a30f Files: 277 Total size: 1.0 MB Directory structure: gitextract_athlf9j7/ ├── .dockerignore ├── .gitattributes ├── .gitignore ├── Blog.IdentityServer/ │ ├── Authorization/ │ │ ├── ClaimRequirement.cs │ │ └── ClaimsRequirementHandler.cs │ ├── Blog.IdentityServer.csproj │ ├── Config.cs │ ├── Controllers/ │ │ ├── Account/ │ │ │ ├── AccountController.cs │ │ │ ├── AccountOptions.cs │ │ │ ├── EditViewModel.cs │ │ │ ├── ExternalController.cs │ │ │ ├── ExternalProvider.cs │ │ │ ├── ForgotPasswordViewModel.cs │ │ │ ├── LoggedOutViewModel.cs │ │ │ ├── LoginInputModel.cs │ │ │ ├── LoginViewModel.cs │ │ │ ├── LogoutInputModel.cs │ │ │ ├── LogoutViewModel.cs │ │ │ ├── RedirectViewModel.cs │ │ │ ├── RegisterViewModel.cs │ │ │ ├── ResetPasswordViewModel.cs │ │ │ ├── RoleEditViewModel.cs │ │ │ ├── RoleRegisterViewModel.cs │ │ │ └── UrlHelperExtensions.cs │ │ ├── ApiResource/ │ │ │ ├── ApiResourceDto.cs │ │ │ └── ApiResourcesManager.cs │ │ ├── Client/ │ │ │ ├── ClientDto.cs │ │ │ └── ClientsManagerController.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 │ │ │ └── Is4ApiController.cs │ │ ├── SecurityHeadersAttribute.cs │ │ └── TestUsers.cs │ ├── Data/ │ │ ├── ApplicationDbContext.cs │ │ └── MigrationsMySql/ │ │ ├── 20200509165505_AppDbMigration.Designer.cs │ │ ├── 20200509165505_AppDbMigration.cs │ │ ├── 20210808045732_addQuestion.Designer.cs │ │ ├── 20210808045732_addQuestion.cs │ │ ├── ApplicationDbContextModelSnapshot.cs │ │ └── IdentityServer/ │ │ ├── ConfigurationDb/ │ │ │ ├── 20200509165153_InitialIdentityServerConfigurationDbMigrationMysql.Designer.cs │ │ │ ├── 20200509165153_InitialIdentityServerConfigurationDbMigrationMysql.cs │ │ │ ├── 20200715033226_InitConfigurationDbV4.Designer.cs │ │ │ ├── 20200715033226_InitConfigurationDbV4.cs │ │ │ └── ConfigurationDbContextModelSnapshot.cs │ │ └── PersistedGrantDb/ │ │ ├── 20200509165052_InitialIdentityServerPersistedGrantDbMigrationMysql.Designer.cs │ │ ├── 20200509165052_InitialIdentityServerPersistedGrantDbMigrationMysql.cs │ │ ├── 20200715032957_InitPersistedGrantDbV4.Designer.cs │ │ ├── 20200715032957_InitPersistedGrantDbV4.cs │ │ └── PersistedGrantDbContextModelSnapshot.cs │ ├── Dockerfile │ ├── Extensions/ │ │ ├── GrantTypeCustom.cs │ │ ├── IpLimitMildd.cs │ │ ├── IpPolicyRateLimitSetup.cs │ │ ├── ResourceOwnerPasswordValidator.cs │ │ └── WeiXinOpenGrantValidator.cs │ ├── Helper/ │ │ ├── Appsettings.cs │ │ ├── FileHelper.cs │ │ ├── GetNetData.cs │ │ ├── HtmlHelper.cs │ │ ├── JsonHelper.cs │ │ ├── MD5Hepler.cs │ │ ├── RecursionHelper.cs │ │ ├── SerializeHelper.cs │ │ ├── UnicodeHelper.cs │ │ └── UtilConvert.cs │ ├── InMemoryConfig.cs │ ├── LICENSE │ ├── Models/ │ │ ├── ApplicationRole.cs │ │ ├── ApplicationUser.cs │ │ ├── ApplicationUserRole.cs │ │ ├── Bak/ │ │ │ ├── Role.cs │ │ │ ├── RootEntity.cs │ │ │ ├── UserRole.cs │ │ │ └── sysUserInfo.cs │ │ ├── Dtos/ │ │ │ └── MessageModel.cs │ │ └── ViewModel/ │ │ └── AccessApiDateView.cs │ ├── Program.cs │ ├── Properties/ │ │ ├── PublishProfiles/ │ │ │ └── FolderProfile.pubxml │ │ └── launchSettings.json │ ├── SameSiteHandlingExtensions.cs │ ├── SeedData.cs │ ├── Startup.cs │ ├── Views/ │ │ ├── Account/ │ │ │ ├── AccessDenied.cshtml │ │ │ ├── ConfirmEmail.cshtml │ │ │ ├── Edit.cshtml │ │ │ ├── ForgotPassword.cshtml │ │ │ ├── ForgotPasswordConfirmation.cshtml │ │ │ ├── LoggedOut.cshtml │ │ │ ├── Login.cshtml │ │ │ ├── Logout.cshtml │ │ │ ├── My.cshtml │ │ │ ├── Register.cshtml │ │ │ ├── ResetPassword.cshtml │ │ │ ├── ResetPasswordConfirmation.cshtml │ │ │ ├── RoleEdit.cshtml │ │ │ ├── RoleRegister.cshtml │ │ │ ├── Roles.cshtml │ │ │ └── Users.cshtml │ │ ├── ApiResourcesManager/ │ │ │ ├── CreateOrEdit.cshtml │ │ │ └── Index.cshtml │ │ ├── ClientsManager/ │ │ │ ├── CreateOrEdit.cshtml │ │ │ └── Index.cshtml │ │ ├── Consent/ │ │ │ └── Index.cshtml │ │ ├── Device/ │ │ │ ├── Success.cshtml │ │ │ ├── UserCodeCapture.cshtml │ │ │ └── UserCodeConfirmation.cshtml │ │ ├── Diagnostics/ │ │ │ └── Index.cshtml │ │ ├── Grants/ │ │ │ ├── Config.cshtml │ │ │ └── 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.jwk │ ├── tempkey.rsa │ └── wwwroot/ │ ├── css/ │ │ ├── login_styles.css │ │ ├── showtip.css │ │ ├── site.css │ │ ├── site.less │ │ └── web.css │ ├── fonts/ │ │ ├── FontAwesome.otf │ │ └── open-iconic.otf │ ├── js/ │ │ ├── Role.js │ │ ├── User.js │ │ ├── bootstrap-show-password.js │ │ ├── showTip.js │ │ ├── signin-redirect.js │ │ └── signout-redirect.js │ └── lib/ │ ├── bootstrap/ │ │ ├── css/ │ │ │ └── bootstrap.css │ │ └── js/ │ │ └── bootstrap.js │ ├── jquery-validation/ │ │ ├── .bower.json │ │ ├── CONTRIBUTING.md │ │ ├── Gruntfile.js │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── bower.json │ │ ├── changelog.md │ │ ├── dist/ │ │ │ ├── additional-methods.js │ │ │ └── jquery.validate.js │ │ ├── package.json │ │ ├── src/ │ │ │ ├── additional/ │ │ │ │ ├── accept.js │ │ │ │ ├── additional.js │ │ │ │ ├── alphanumeric.js │ │ │ │ ├── bankaccountNL.js │ │ │ │ ├── bankorgiroaccountNL.js │ │ │ │ ├── bic.js │ │ │ │ ├── cifES.js │ │ │ │ ├── cpfBR.js │ │ │ │ ├── creditcardtypes.js │ │ │ │ ├── currency.js │ │ │ │ ├── dateFA.js │ │ │ │ ├── dateITA.js │ │ │ │ ├── dateNL.js │ │ │ │ ├── extension.js │ │ │ │ ├── giroaccountNL.js │ │ │ │ ├── iban.js │ │ │ │ ├── integer.js │ │ │ │ ├── ipv4.js │ │ │ │ ├── ipv6.js │ │ │ │ ├── lettersonly.js │ │ │ │ ├── letterswithbasicpunc.js │ │ │ │ ├── mobileNL.js │ │ │ │ ├── mobileUK.js │ │ │ │ ├── nieES.js │ │ │ │ ├── nifES.js │ │ │ │ ├── notEqualTo.js │ │ │ │ ├── nowhitespace.js │ │ │ │ ├── pattern.js │ │ │ │ ├── phoneNL.js │ │ │ │ ├── phoneUK.js │ │ │ │ ├── phoneUS.js │ │ │ │ ├── phonesUK.js │ │ │ │ ├── postalCodeCA.js │ │ │ │ ├── postalcodeBR.js │ │ │ │ ├── postalcodeIT.js │ │ │ │ ├── postalcodeNL.js │ │ │ │ ├── postcodeUK.js │ │ │ │ ├── require_from_group.js │ │ │ │ ├── skip_or_fill_minimum.js │ │ │ │ ├── statesUS.js │ │ │ │ ├── strippedminlength.js │ │ │ │ ├── time.js │ │ │ │ ├── time12h.js │ │ │ │ ├── url2.js │ │ │ │ ├── vinUS.js │ │ │ │ ├── zipcodeUS.js │ │ │ │ └── ziprange.js │ │ │ ├── ajax.js │ │ │ ├── core.js │ │ │ └── localization/ │ │ │ ├── messages_ar.js │ │ │ ├── messages_bg.js │ │ │ ├── messages_bn_BD.js │ │ │ ├── messages_ca.js │ │ │ ├── messages_cs.js │ │ │ ├── messages_da.js │ │ │ ├── messages_de.js │ │ │ ├── messages_el.js │ │ │ ├── messages_es.js │ │ │ ├── messages_es_AR.js │ │ │ ├── messages_es_PE.js │ │ │ ├── messages_et.js │ │ │ ├── messages_eu.js │ │ │ ├── messages_fa.js │ │ │ ├── messages_fi.js │ │ │ ├── messages_fr.js │ │ │ ├── messages_ge.js │ │ │ ├── messages_gl.js │ │ │ ├── messages_he.js │ │ │ ├── messages_hr.js │ │ │ ├── messages_hu.js │ │ │ ├── messages_hy_AM.js │ │ │ ├── messages_id.js │ │ │ ├── messages_is.js │ │ │ ├── messages_it.js │ │ │ ├── messages_ja.js │ │ │ ├── messages_ka.js │ │ │ ├── messages_kk.js │ │ │ ├── messages_ko.js │ │ │ ├── messages_lt.js │ │ │ ├── messages_lv.js │ │ │ ├── messages_my.js │ │ │ ├── messages_nl.js │ │ │ ├── messages_no.js │ │ │ ├── messages_pl.js │ │ │ ├── messages_pt_BR.js │ │ │ ├── messages_pt_PT.js │ │ │ ├── messages_ro.js │ │ │ ├── messages_ru.js │ │ │ ├── messages_si.js │ │ │ ├── messages_sk.js │ │ │ ├── messages_sl.js │ │ │ ├── messages_sr.js │ │ │ ├── messages_sr_lat.js │ │ │ ├── messages_sv.js │ │ │ ├── messages_th.js │ │ │ ├── messages_tj.js │ │ │ ├── messages_tr.js │ │ │ ├── messages_uk.js │ │ │ ├── messages_vi.js │ │ │ ├── messages_zh.js │ │ │ ├── messages_zh_TW.js │ │ │ ├── methods_de.js │ │ │ ├── methods_es_CL.js │ │ │ ├── methods_fi.js │ │ │ ├── methods_nl.js │ │ │ └── methods_pt.js │ │ └── validation.jquery.json │ └── jquery-validation-unobtrusive/ │ ├── .bower.json │ ├── LICENSE.txt │ ├── bower.json │ └── jquery.validate.unobtrusive.js ├── Blog.IdentityServer.Publish.Docker.sh ├── Blog.IdentityServer.Publish.Linux.sh ├── Blog.IdentityServer.sln ├── Build.bat ├── Dockerfile └── README.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: .dockerignore ================================================ **/.classpath **/.dockerignore **/.env **/.git **/.gitignore **/.project **/.settings **/.toolstarget **/.vs **/.vscode **/*.*proj.user **/*.dbmdl **/*.jfm **/azds.yaml **/bin **/charts **/docker-compose* **/Dockerfile* **/node_modules **/npm-debug.log **/obj **/secrets.dev.yaml **/values.dev.yaml LICENSE README.md ================================================ FILE: .gitattributes ================================================ ############################################################################### # Set default behavior to automatically normalize line endings. ############################################################################### * text=auto ############################################################################### # Set default behavior for command prompt diff. # # This is need for earlier builds of msysgit that does not have it on by # default for csharp files. # Note: This is only used by command line ############################################################################### #*.cs diff=csharp ############################################################################### # Set the merge driver for project and solution files # # Merging from the command prompt will add diff markers to the files if there # are conflicts (Merging from VS is not affected by the settings below, in VS # the diff markers are never inserted). Diff markers may cause the following # file extensions to fail to load in VS. An alternative would be to treat # these files as binary and thus will always conflict and require user # intervention with every merge. To do so, just uncomment the entries below ############################################################################### #*.sln merge=binary #*.csproj merge=binary #*.vbproj merge=binary #*.vcxproj merge=binary #*.vcproj merge=binary #*.dbproj merge=binary #*.fsproj merge=binary #*.lsproj merge=binary #*.wixproj merge=binary #*.modelproj merge=binary #*.sqlproj merge=binary #*.wwaproj merge=binary ############################################################################### # behavior for image files # # image files are treated as binary by default. ############################################################################### #*.jpg binary #*.png binary #*.gif binary ############################################################################### # diff behavior for common document formats # # Convert binary document formats to text before diffing them. This feature # is only available from the command line. Turn it on by uncommenting the # entries below. ############################################################################### #*.doc diff=astextplain #*.DOC diff=astextplain #*.docx diff=astextplain #*.DOCX diff=astextplain #*.dot diff=astextplain #*.DOT diff=astextplain #*.pdf diff=astextplain #*.PDF diff=astextplain #*.rtf diff=astextplain #*.RTF diff=astextplain ================================================ FILE: .gitignore ================================================ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # User-specific files *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ # Visual Studio 2015 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUNIT *.VisualState.xml TestResult.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c # DNX project.lock.json project.fragment.lock.json artifacts/ *_i.c *_p.c *_i.h *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.svclog *.scc # Chutzpah Test files _Chutzpah* # Visual C++ cache files ipch/ *.aps *.ncb *.opendb *.opensdf *.sdf *.cachefile *.VC.db *.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx *.sap # TFS 2012 Local Workspace $tf/ # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user # JustCode is a .NET coding add-in .JustCode # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # NCrunch _NCrunch_* .*crunch*.local.xml nCrunchTemp_* # MightyMoose *.mm.* AutoTest.Net/ # Web workbench (sass) .sass-cache/ # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml # TODO: Comment the next line if you want to checkin your web deploy settings # but database connection strings (with potential passwords) will be unencrypted #*.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to # checkin your Azure Web App publish settings, but sensitive information contained # in these scripts will be unencrypted PublishScripts/ # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore **/packages/* # except build/, which is used as an MSBuild target. !**/packages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config # NuGet v3's project.json files produces more ignoreable files *.nuget.props *.nuget.targets # Microsoft Azure Build Output csx/ *.build.csdef # Microsoft Azure Emulator ecf/ rcf/ # Windows Store app package directories and files AppPackages/ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !*.[Cc]ache/ # Others ClientBin/ ~$* *~ *.dbmdl *.dbproj.schemaview *.jfm *.pfx *.publishsettings node_modules/ orleans.codegen.cs # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file # to a newer Visual Studio version. Backup files are not needed, # because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files *.mdf *.ldf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings # Microsoft Fakes FakesAssemblies/ # GhostDoc plugin setting file *.GhostDoc.xml # Node.js Tools for Visual Studio .ntvs_analysis.dat # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts **/*.DesktopClient/ModelManifest.xml **/*.Server/GeneratedArtifacts **/*.Server/ModelManifest.xml _Pvt_Extensions # Paket dependency manager .paket/paket.exe paket-files/ # FAKE - F# Make .fake/ # JetBrains Rider .idea/ *.sln.iml # CodeRush .cr/ # Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc *Logs/ ================================================ FILE: Blog.IdentityServer/Authorization/ClaimRequirement.cs ================================================ using Microsoft.AspNetCore.Authorization; namespace Blog.IdentityServer.Authorization { public class ClaimRequirement : IAuthorizationRequirement { public ClaimRequirement(string claimName, string claimValue) { ClaimName = claimName; ClaimValue = claimValue; } public string ClaimName { get; set; } public string ClaimValue { get; set; } } } ================================================ FILE: Blog.IdentityServer/Authorization/ClaimsRequirementHandler.cs ================================================ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; namespace Blog.IdentityServer.Authorization { public class ClaimsRequirementHandler : AuthorizationHandler { protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ClaimRequirement requirement) { var claim = context.User.Claims.FirstOrDefault(c => c.Type == requirement.ClaimName); if (claim != null && claim.Value.Contains(requirement.ClaimValue)) { context.Succeed(requirement); } return Task.CompletedTask; } } } ================================================ FILE: Blog.IdentityServer/Blog.IdentityServer.csproj ================================================  netcoreapp3.1 aspnet-IdentityServerWithAspNetIdentity-04C6939F-E672-4E56-B4A5-5F064EB67F23 Blog.IdentityServer Blog.IdentityServer Linux all runtime; build; native; contentfiles; analyzers all runtime; build; native; contentfiles; analyzers; buildtransitive Always ================================================ FILE: Blog.IdentityServer/Config.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using Blog.IdentityServer.Extensions; using IdentityModel; using IdentityServer4; using IdentityServer4.Models; using System.Collections.Generic; using System.Linq; namespace Blog.IdentityServer { public class Config { // scopes define the resources in your system public static IEnumerable GetIdentityResources() { return new List { new IdentityResources.OpenId(), new IdentityResources.Profile(), new IdentityResources.Email(), new IdentityResource("roles", "角色", new List { JwtClaimTypes.Role }), new IdentityResource("rolename", "角色名", new List { "rolename" }), }; } // v4更新 public static IEnumerable GetApiScopes() { return new ApiScope[] { new ApiScope("blog.core.api"), new ApiScope("blog.core.api.BlogModule"), }; } public static IEnumerable GetApiResources() { // blog.core 项目 return new List { new ApiResource("blog.core.api", "Blog.Core API") { // include the following using claims in access token (in addition to subject id) //requires using using IdentityModel; UserClaims = { JwtClaimTypes.Name, JwtClaimTypes.Role,"rolename" }, // v4更新 Scopes={ "blog.core.api","blog.core.api.BlogModule"}, ApiSecrets = new List() { new Secret("api_secret".Sha256()) }, } }; } // clients want to access resources (aka scopes) public static IEnumerable GetClients() { // client return new List { // 1、blog.vue 前端vue项目 new Client { ClientId = "blogvuejs", ClientName = "Blog.Vue JavaScript Client", AllowedGrantTypes = GrantTypes.Implicit, AllowAccessTokensViaBrowser = true, RedirectUris = { "http://vueblog.neters.club/callback", "http://apk.neters.club/oauth2-redirect.html", "http://localhost:6688/callback", "http://localhost:8081/oauth2-redirect.html", }, PostLogoutRedirectUris = { "http://vueblog.neters.club","http://localhost:6688" }, AllowedCorsOrigins = { "http://vueblog.neters.club","http://localhost:6688" }, AccessTokenLifetime=3600, AllowedScopes = { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, "roles", "blog.core.api.BlogModule" } }, // 2、blog.admin 前端vue项目 new Client { ClientId = "blogadminjs", ClientName = "Blog.Admin JavaScript Client", AllowedGrantTypes = GrantTypes.Implicit, AllowAccessTokensViaBrowser = true, RedirectUris = { "http://vueadmin.neters.club/callback", "http://apk.neters.club/oauth2-redirect.html", "http://localhost:2364/callback", "http://localhost:8081/oauth2-redirect.html", }, PostLogoutRedirectUris = { "http://vueadmin.neters.club","http://localhost:2364" }, AllowedCorsOrigins = { "http://vueadmin.neters.club","http://localhost:2364" }, AccessTokenLifetime=3600, AllowedScopes = { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, "roles", "blog.core.api" } }, // 3、nuxt.tbug 前端nuxt项目 new Client { ClientId = "tibugnuxtjs", ClientName = "Nuxt.tBug JavaScript Client", AllowedGrantTypes = GrantTypes.Implicit, AllowAccessTokensViaBrowser = true, RedirectUris = { "http://tibug.neters.club/callback" }, PostLogoutRedirectUris = { "http://tibug.neters.club" }, AllowedCorsOrigins = { "http://tibug.neters.club" }, AccessTokenLifetime=3600, AllowedScopes = { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, "roles", "blog.core.api" } }, // 4、DDD 后端MVC项目 new Client { ClientId = "chrisdddmvc", ClientSecrets = { new Secret("secret".Sha256()) }, AllowedGrantTypes = GrantTypes.Code, RequireConsent = false, RequirePkce = true, AlwaysIncludeUserClaimsInIdToken=true,//将用户所有的claims包含在IdToken内 // where to redirect to after login RedirectUris = { "http://ddd.neters.club/signin-oidc" }, // where to redirect to after logout PostLogoutRedirectUris = { "http://ddd.neters.club/signout-callback-oidc" }, AllowedScopes = new List { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, IdentityServerConstants.StandardScopes.Email, "roles", "rolename", } }, // 5、控制台客户端 new Client { ClientId = "Console", ClientSecrets = { new Secret("secret".Sha256()) }, AllowOfflineAccess = true,//如果要获取refresh_tokens ,必须把AllowOfflineAccess设置为true AllowedGrantTypes = new List() { GrantTypes.ResourceOwnerPassword.FirstOrDefault(), GrantTypes.ClientCredentials.FirstOrDefault(), GrantTypeCustom.ResourceWeixinOpen, }, AllowedScopes = new List { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, "offline_access", "blog.core.api" } }, // 6、mvp 后端blazor.server项目 new Client { ClientId = "blazorserver", ClientSecrets = { new Secret("secret".Sha256()) }, AllowedGrantTypes = GrantTypes.Code, RequireConsent = false, RequirePkce = true, AlwaysIncludeUserClaimsInIdToken=true,//将用户所有的claims包含在IdToken内 AllowAccessTokensViaBrowser = true, // where to redirect to after login RedirectUris = { "https://mvp.neters.club/signin-oidc" }, AllowedCorsOrigins = { "https://mvp.neters.club" }, // where to redirect to after logout PostLogoutRedirectUris = { "https://mvp.neters.club/signout-callback-oidc" }, AllowedScopes = new List { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, IdentityServerConstants.StandardScopes.Email, "roles", "rolename", "blog.core.api" } }, // 7、测试 hybrid 模式 new Client { ClientId = "hybridclent", ClientName="Demo MVC Client", ClientSecrets = { new Secret("secret".Sha256()) }, AllowedGrantTypes = GrantTypes.Hybrid, RequirePkce = false, RedirectUris = { "http://localhost:1003/signin-oidc" }, PostLogoutRedirectUris = { "http://localhost:1003/signout-callback-oidc" }, AllowOfflineAccess=true, AlwaysIncludeUserClaimsInIdToken=true, AllowedScopes = new List { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, IdentityServerConstants.StandardScopes.Email, "roles", "rolename", "blog.core.api" } } }; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/AccountController.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityServer4.Services; using IdentityServer4.Stores; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; using IdentityServer4.Events; using IdentityServer4.Models; using Microsoft.AspNetCore.Identity; using IdentityServer4.Extensions; using System.Security.Principal; using System.Security.Claims; using IdentityModel; using System.Linq; using System; using System.Collections.Generic; using Blog.IdentityServer.Models; using Microsoft.AspNetCore.Authorization; using Blog.Core.Common.Helper; namespace IdentityServer4.Quickstart.UI { [SecurityHeaders] public class AccountController : Controller { private readonly UserManager _userManager; private readonly RoleManager _roleManager; private readonly SignInManager _signInManager; private readonly IIdentityServerInteractionService _interaction; private readonly IClientStore _clientStore; private readonly IAuthenticationSchemeProvider _schemeProvider; private readonly IEventService _events; public AccountController( UserManager userManager, RoleManager roleManager, SignInManager signInManager, IIdentityServerInteractionService interaction, IClientStore clientStore, IAuthenticationSchemeProvider schemeProvider, IEventService events) { _userManager = userManager; _roleManager = roleManager; _signInManager = signInManager; _interaction = interaction; _clientStore = clientStore; _schemeProvider = schemeProvider; _events = events; } /// /// Show login page /// [HttpGet] [Route("oauth2/authorize")] public async Task Login(string returnUrl) { // build a model so we know what to show on the login page var vm = await BuildLoginViewModelAsync(returnUrl); if (vm.IsExternalLoginOnly) { // we only have one option for logging in and it's an external provider return await ExternalLogin(vm.ExternalLoginScheme, returnUrl); } return View(vm); } /// /// Handle postback from username/password login /// [HttpPost] [ValidateAntiForgeryToken] [Route("oauth2/authorize")] public async Task Login(LoginInputModel model, string button) { // check if we are in the context of an authorization request var context = await _interaction.GetAuthorizationContextAsync(model.ReturnUrl); if (button != "login") { if (context != null) { // if the user cancels, send a result back into IdentityServer as if they // denied the consent (even if this client does not require consent). // this will send back an access denied OIDC error response to the client. await _interaction.DenyAuthorizationAsync(context, AuthorizationError.AccessDenied); // we can trust model.ReturnUrl since GetAuthorizationContextAsync returned non-null if (context.IsNativeClient()) { // The client is native, so this change in how to // return the response is for better UX for the end user. return this.LoadingPage("Redirect", model.ReturnUrl); } return Redirect(model.ReturnUrl); } else { // since we don't have a valid context, then we just go back to the home page return Redirect("~/"); } } if (ModelState.IsValid) { var user = _userManager.Users.FirstOrDefault(d => (d.LoginName == model.Username || d.Email == model.Username) && !d.tdIsDelete); if (user != null && !user.tdIsDelete) { var result = await _signInManager.PasswordSignInAsync(user.LoginName, model.Password, model.RememberLogin, lockoutOnFailure: true); if (result.Succeeded) { await _events.RaiseAsync(new UserLoginSuccessEvent(user.UserName, user.Id.ToString(), user.UserName)); // make sure the returnUrl is still valid, and if so redirect back to authorize endpoint or a local page // the IsLocalUrl check is only necessary if you want to support additional local pages, otherwise IsValidReturnUrl is more strict if (_interaction.IsValidReturnUrl(model.ReturnUrl) || Url.IsLocalUrl(model.ReturnUrl)) { return Redirect(model.ReturnUrl); } return Redirect("~/"); } else { var result2 = await _signInManager.PasswordSignInAsync(user.UserName, model.Password, model.RememberLogin, lockoutOnFailure: true); if (result2.Succeeded) { await _events.RaiseAsync(new UserLoginSuccessEvent(user.UserName, user.Id.ToString(), user.UserName)); // make sure the returnUrl is still valid, and if so redirect back to authorize endpoint or a local page // the IsLocalUrl check is only necessary if you want to support additional local pages, otherwise IsValidReturnUrl is more strict if (_interaction.IsValidReturnUrl(model.ReturnUrl) || Url.IsLocalUrl(model.ReturnUrl)) { return Redirect(model.ReturnUrl); } return Redirect("~/"); } } } await _events.RaiseAsync(new UserLoginFailureEvent(model.Username, "invalid credentials")); ModelState.AddModelError("", AccountOptions.InvalidCredentialsErrorMessage); } // something went wrong, show form with error var vm = await BuildLoginViewModelAsync(model); return View(vm); } /// /// initiate roundtrip to external authentication provider /// [HttpGet] public async Task ExternalLogin(string provider, string returnUrl) { if (AccountOptions.WindowsAuthenticationSchemeName == provider) { // windows authentication needs special handling return await ProcessWindowsLoginAsync(returnUrl); } else { // start challenge and roundtrip the return URL and var props = new AuthenticationProperties() { RedirectUri = Url.Action("ExternalLoginCallback"), Items = { { "returnUrl", returnUrl }, { "scheme", provider }, } }; return Challenge(props, provider); } } /// /// Post processing of external authentication /// [HttpGet] public async Task ExternalLoginCallback() { // read external identity from the temporary cookie var result = await HttpContext.AuthenticateAsync(IdentityConstants.ExternalScheme); if (result?.Succeeded != true) { throw new Exception("External authentication error"); } // lookup our user and external provider info var (user, provider, providerUserId, claims) = await FindUserFromExternalProviderAsync(result); if (user == null) { // this might be where you might initiate a custom workflow for user registration // in this sample we don't show how that would be done, as our sample implementation // simply auto-provisions new external user user = await AutoProvisionUserAsync(provider, providerUserId, claims); } // this allows us to collect any additonal claims or properties // for the specific prtotocols used and store them in the local auth cookie. // this is typically used to store data needed for signout from those protocols. var additionalLocalClaims = new List(); var localSignInProps = new AuthenticationProperties(); ProcessLoginCallbackForOidc(result, additionalLocalClaims, localSignInProps); ProcessLoginCallbackForWsFed(result, additionalLocalClaims, localSignInProps); ProcessLoginCallbackForSaml2p(result, additionalLocalClaims, localSignInProps); // issue authentication cookie for user // we must issue the cookie maually, and can't use the SignInManager because // it doesn't expose an API to issue additional claims from the login workflow var principal = await _signInManager.CreateUserPrincipalAsync(user); additionalLocalClaims.AddRange(principal.Claims); var name = principal.FindFirst(JwtClaimTypes.Name)?.Value ?? user.Id.ToString(); await _events.RaiseAsync(new UserLoginSuccessEvent(provider, providerUserId, user.Id.ToString(), name)); //await HttpContext.SignInAsync(user.Id.ToString(), name, provider, localSignInProps, additionalLocalClaims.ToArray()); var isuser = new IdentityServerUser(user.Id.ToString()) { DisplayName = name, IdentityProvider = provider, AdditionalClaims = additionalLocalClaims }; await HttpContext.SignInAsync(isuser, localSignInProps); // delete temporary cookie used during external authentication await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme); // validate return URL and redirect back to authorization endpoint or a local page var returnUrl = result.Properties.Items["returnUrl"]; if (_interaction.IsValidReturnUrl(returnUrl) || Url.IsLocalUrl(returnUrl)) { return Redirect(returnUrl); } return Redirect("~/"); } /// /// Show logout page /// [HttpGet] public async Task Logout(string logoutId) { // build a model so the logout page knows what to display var vm = await BuildLogoutViewModelAsync(logoutId); if (vm.ShowLogoutPrompt == false) { // if the request for logout was properly authenticated from IdentityServer, then // we don't need to show the prompt and can just log the user out directly. return await Logout(vm); } return View(vm); } /// /// Handle logout page postback /// [HttpPost] [ValidateAntiForgeryToken] public async Task Logout(LogoutInputModel model) { // build a model so the logged out page knows what to display var vm = await BuildLoggedOutViewModelAsync(model.LogoutId); if (User?.Identity.IsAuthenticated == true) { // delete local authentication cookie await _signInManager.SignOutAsync(); // raise the logout event await _events.RaiseAsync(new UserLogoutSuccessEvent(User.GetSubjectId(), User.GetDisplayName())); } // check if we need to trigger sign-out at an upstream identity provider if (vm.TriggerExternalSignout) { // build a return URL so the upstream provider will redirect back // to us after the user has logged out. this allows us to then // complete our single sign-out processing. string url = Url.Action("Logout", new { logoutId = vm.LogoutId }); // this triggers a redirect to the external provider for sign-out return SignOut(new AuthenticationProperties { RedirectUri = url }, vm.ExternalAuthenticationScheme); } return View("LoggedOut", vm); } /*****************************************/ /* helper APIs for the AccountController */ /*****************************************/ private async Task BuildLoginViewModelAsync(string returnUrl) { var context = await _interaction.GetAuthorizationContextAsync(returnUrl); if (context?.IdP != null) { // this is meant to short circuit the UI and only trigger the one external IdP return new LoginViewModel { EnableLocalLogin = false, ReturnUrl = returnUrl, Username = context?.LoginHint, ExternalProviders = new ExternalProvider[] { new ExternalProvider { AuthenticationScheme = context.IdP } } }; } var schemes = await _schemeProvider.GetAllSchemesAsync(); var providers = schemes .Where(x => x.DisplayName != null || (x.Name.Equals(AccountOptions.WindowsAuthenticationSchemeName, StringComparison.OrdinalIgnoreCase)) ) .Select(x => new ExternalProvider { DisplayName = x.DisplayName, AuthenticationScheme = x.Name }).ToList(); var allowLocal = true; if (context?.Client.ClientId != null) { var client = await _clientStore.FindEnabledClientByIdAsync(context.Client.ClientId); if (client != null) { allowLocal = client.EnableLocalLogin; if (client.IdentityProviderRestrictions != null && client.IdentityProviderRestrictions.Any()) { providers = providers.Where(provider => client.IdentityProviderRestrictions.Contains(provider.AuthenticationScheme)).ToList(); } } } return new LoginViewModel { AllowRememberLogin = AccountOptions.AllowRememberLogin, EnableLocalLogin = allowLocal && AccountOptions.AllowLocalLogin, ReturnUrl = returnUrl, Username = context?.LoginHint, ExternalProviders = providers.ToArray() }; } private async Task BuildLoginViewModelAsync(LoginInputModel model) { var vm = await BuildLoginViewModelAsync(model.ReturnUrl); vm.Username = model.Username; vm.RememberLogin = model.RememberLogin; return vm; } private async Task BuildLogoutViewModelAsync(string logoutId) { var vm = new LogoutViewModel { LogoutId = logoutId, ShowLogoutPrompt = AccountOptions.ShowLogoutPrompt }; if (User?.Identity.IsAuthenticated != true) { // if the user is not authenticated, then just show logged out page vm.ShowLogoutPrompt = false; return vm; } var context = await _interaction.GetLogoutContextAsync(logoutId); if (context?.ShowSignoutPrompt == false) { // it's safe to automatically sign-out vm.ShowLogoutPrompt = false; return vm; } // show the logout prompt. this prevents attacks where the user // is automatically signed out by another malicious web page. return vm; } private async Task BuildLoggedOutViewModelAsync(string logoutId) { // get context information (client name, post logout redirect URI and iframe for federated signout) var logout = await _interaction.GetLogoutContextAsync(logoutId); var vm = new LoggedOutViewModel { AutomaticRedirectAfterSignOut = AccountOptions.AutomaticRedirectAfterSignOut, PostLogoutRedirectUri = logout?.PostLogoutRedirectUri, ClientName = string.IsNullOrEmpty(logout?.ClientName) ? logout?.ClientId : logout?.ClientName, SignOutIframeUrl = logout?.SignOutIFrameUrl, LogoutId = logoutId }; if (User?.Identity.IsAuthenticated == true) { var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider) { var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(idp); if (providerSupportsSignout) { if (vm.LogoutId == null) { // if there's no current logout context, we need to create one // this captures necessary info from the current logged in user // before we signout and redirect away to the external IdP for signout vm.LogoutId = await _interaction.CreateLogoutContextAsync(); } vm.ExternalAuthenticationScheme = idp; } } } return vm; } private async Task ProcessWindowsLoginAsync(string returnUrl) { // see if windows auth has already been requested and succeeded var result = await HttpContext.AuthenticateAsync(AccountOptions.WindowsAuthenticationSchemeName); if (result?.Principal is WindowsPrincipal wp) { // we will issue the external cookie and then redirect the // user back to the external callback, in essence, tresting windows // auth the same as any other external authentication mechanism var props = new AuthenticationProperties() { RedirectUri = Url.Action("ExternalLoginCallback"), Items = { { "returnUrl", returnUrl }, { "scheme", AccountOptions.WindowsAuthenticationSchemeName }, } }; var id = new ClaimsIdentity(AccountOptions.WindowsAuthenticationSchemeName); id.AddClaim(new Claim(JwtClaimTypes.Subject, wp.Identity.Name)); id.AddClaim(new Claim(JwtClaimTypes.Name, wp.Identity.Name)); // add the groups as claims -- be careful if the number of groups is too large if (AccountOptions.IncludeWindowsGroups) { var wi = wp.Identity as WindowsIdentity; var groups = wi.Groups.Translate(typeof(NTAccount)); var roles = groups.Select(x => new Claim(JwtClaimTypes.Role, x.Value)); id.AddClaims(roles); } await HttpContext.SignInAsync( IdentityServer4.IdentityServerConstants.ExternalCookieAuthenticationScheme, new ClaimsPrincipal(id), props); return Redirect(props.RedirectUri); } else { // trigger windows auth // since windows auth don't support the redirect uri, // this URL is re-triggered when we call challenge return Challenge(AccountOptions.WindowsAuthenticationSchemeName); } } private async Task<(ApplicationUser user, string provider, string providerUserId, IEnumerable claims)> FindUserFromExternalProviderAsync(AuthenticateResult result) { var externalUser = result.Principal; // try to determine the unique id of the external user (issued by the provider) // the most common claim type for that are the sub claim and the NameIdentifier // depending on the external provider, some other claim type might be used var userIdClaim = externalUser.FindFirst(JwtClaimTypes.Subject) ?? externalUser.FindFirst(ClaimTypes.NameIdentifier) ?? throw new Exception("Unknown userid"); // remove the user id claim so we don't include it as an extra claim if/when we provision the user var claims = externalUser.Claims.ToList(); claims.Remove(userIdClaim); var provider = result.Properties.Items["scheme"]; var providerUserId = userIdClaim.Value; // find external user var user = await _userManager.FindByLoginAsync(provider, providerUserId); return (user, provider, providerUserId, claims); } private async Task AutoProvisionUserAsync(string provider, string providerUserId, IEnumerable claims) { // create a list of claims that we want to transfer into our store var filtered = new List(); // user's display name var name = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.Name)?.Value ?? claims.FirstOrDefault(x => x.Type == ClaimTypes.Name)?.Value; if (name != null) { filtered.Add(new Claim(JwtClaimTypes.Name, name)); } else { var first = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.GivenName)?.Value ?? claims.FirstOrDefault(x => x.Type == ClaimTypes.GivenName)?.Value; var last = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.FamilyName)?.Value ?? claims.FirstOrDefault(x => x.Type == ClaimTypes.Surname)?.Value; if (first != null && last != null) { filtered.Add(new Claim(JwtClaimTypes.Name, first + " " + last)); } else if (first != null) { filtered.Add(new Claim(JwtClaimTypes.Name, first)); } else if (last != null) { filtered.Add(new Claim(JwtClaimTypes.Name, last)); } } // email var email = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.Email)?.Value ?? claims.FirstOrDefault(x => x.Type == ClaimTypes.Email)?.Value; if (email != null) { filtered.Add(new Claim(JwtClaimTypes.Email, email)); } var user = new ApplicationUser { UserName = Guid.NewGuid().ToString(), }; var identityResult = await _userManager.CreateAsync(user); if (!identityResult.Succeeded) throw new Exception(identityResult.Errors.First().Description); if (filtered.Any()) { identityResult = await _userManager.AddClaimsAsync(user, filtered); if (!identityResult.Succeeded) throw new Exception(identityResult.Errors.First().Description); } identityResult = await _userManager.AddLoginAsync(user, new UserLoginInfo(provider, providerUserId, provider)); if (!identityResult.Succeeded) throw new Exception(identityResult.Errors.First().Description); return user; } private void ProcessLoginCallbackForOidc(AuthenticateResult externalResult, List localClaims, AuthenticationProperties localSignInProps) { // if the external system sent a session id claim, copy it over // so we can use it for single sign-out var sid = externalResult.Principal.Claims.FirstOrDefault(x => x.Type == JwtClaimTypes.SessionId); if (sid != null) { localClaims.Add(new Claim(JwtClaimTypes.SessionId, sid.Value)); } // if the external provider issued an id_token, we'll keep it for signout var id_token = externalResult.Properties.GetTokenValue("id_token"); if (id_token != null) { localSignInProps.StoreTokens(new[] { new AuthenticationToken { Name = "id_token", Value = id_token } }); } } private void ProcessLoginCallbackForWsFed(AuthenticateResult externalResult, List localClaims, AuthenticationProperties localSignInProps) { } private void ProcessLoginCallbackForSaml2p(AuthenticateResult externalResult, List localClaims, AuthenticationProperties localSignInProps) { } [HttpGet] [Route("account/register")] public IActionResult Register(string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; return View(); } [HttpPost] [Route("account/register")] [ValidateAntiForgeryToken] public async Task Register(RegisterViewModel model, string returnUrl = null, string rName = "AdminTest") { ViewData["ReturnUrl"] = returnUrl; IdentityResult result = new IdentityResult(); if (ModelState.IsValid) { var userItem = _userManager.FindByNameAsync(model.LoginName).Result; if (userItem == null) { var user = new ApplicationUser { Email = model.Email, UserName = model.LoginName, LoginName = model.RealName, sex = model.Sex, age = model.Birth.Year - DateTime.Now.Year, birth = model.Birth, FirstQuestion = model.FirstQuestion, SecondQuestion = model.SecondQuestion, addr = "", tdIsDelete = false }; result = await _userManager.CreateAsync(user, model.Password); if (result.Succeeded) { //var claims = new List{ // new Claim(JwtClaimTypes.Name, model.RealName), // new Claim(JwtClaimTypes.Email, model.Email), // new Claim(JwtClaimTypes.EmailVerified, "false", ClaimValueTypes.Boolean), // new Claim("rolename", rName), // }; //claims.AddRange((new List { 6 }).Select(s => new Claim(JwtClaimTypes.Role, s.ToString()))); //result = _userManager.AddClaimsAsync(userItem, claims).Result; result = await _userManager.AddClaimsAsync(user, new Claim[]{ new Claim(JwtClaimTypes.Name, model.RealName), new Claim(JwtClaimTypes.Email, model.Email), new Claim(JwtClaimTypes.EmailVerified, "false", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.Role, "6"), new Claim("rolename", rName), }); if (result.Succeeded) { // 可以直接登录 //await _signInManager.SignInAsync(user, isPersistent: false); return RedirectToLocal(returnUrl); } } } else { ModelState.AddModelError(string.Empty, $"{userItem?.UserName} already exists"); } AddErrors(result); } // If we got this far, something failed, redisplay form return View(model); } [HttpGet] [Route("account/users")] [Authorize] public IActionResult Users(string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; var users = _userManager.Users.Where(d => !d.tdIsDelete).OrderByDescending(d => d.Id).Take(50).ToList(); return View(users); } [HttpGet("{id}")] [Route("account/edit/{id}")] [Authorize(Policy = "SuperAdmin")] public async Task Edit(string id, string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; if (id == null) { return NotFound(); } var user = await _userManager.FindByIdAsync(id); if (user == null) { return NotFound(); } return View(new EditViewModel(user.Id.ToString(), user.LoginName, user.UserName, user.Email, await _userManager.GetClaimsAsync(user), user.FirstQuestion, user.SecondQuestion)); } [HttpPost] [Route("account/edit/{id}")] [ValidateAntiForgeryToken] [Authorize(Policy = "SuperAdmin")] public async Task Edit(EditViewModel model, string id, string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; IdentityResult result = new IdentityResult(); if (ModelState.IsValid) { var userItem = _userManager.FindByIdAsync(model.Id).Result; if (userItem != null) { var oldName = userItem.LoginName; var oldEmail = userItem.Email; userItem.UserName = model.LoginName; userItem.LoginName = model.UserName; userItem.Email = model.Email; userItem.RealName = model.UserName; result = await _userManager.UpdateAsync(userItem); if (result.Succeeded) { var removeClaimsIdRst = await _userManager.RemoveClaimsAsync(userItem, new Claim[]{ new Claim(JwtClaimTypes.Name, oldName), new Claim(JwtClaimTypes.Email, oldEmail), }); if (removeClaimsIdRst.Succeeded) { var addClaimsIdRst = await _userManager.AddClaimsAsync(userItem, new Claim[]{ new Claim(JwtClaimTypes.Name, userItem.LoginName), new Claim(JwtClaimTypes.Email, userItem.Email), }); if (addClaimsIdRst.Succeeded) { return RedirectToLocal(returnUrl); } else { AddErrors(addClaimsIdRst); } } else { AddErrors(removeClaimsIdRst); } } } else { ModelState.AddModelError(string.Empty, $"{userItem?.UserName} no exist!"); } AddErrors(result); } // If we got this far, something failed, redisplay form return View(model); } [HttpGet] [Route("account/my")] [Authorize] public async Task My(string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; var id = (int.Parse)(HttpContext.User.Claims.FirstOrDefault(c => c.Type == "sub")?.Value); if (id <= 0) { return NotFound(); } var user = await _userManager.FindByIdAsync(id.ToString()); if (user == null) { return NotFound(); } return View(new EditViewModel(user.Id.ToString(), user.LoginName, user.UserName, user.Email, await _userManager.GetClaimsAsync(user), user.FirstQuestion, user.SecondQuestion)); } [HttpPost] [Route("account/my")] [ValidateAntiForgeryToken] [Authorize] public async Task My(EditViewModel model, string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; IdentityResult result = new IdentityResult(); if (ModelState.IsValid) { var id = (int.Parse)(HttpContext.User.Claims.FirstOrDefault(c => c.Type == "sub")?.Value); if (id <= 0) { return NotFound(); } // id为当前登录人 if (model.Id == id.ToString()) { var userItem = _userManager.FindByIdAsync(model.Id).Result; if (userItem != null) { var oldName = userItem.LoginName; var oldEmail = userItem.Email; userItem.UserName = model.LoginName; userItem.LoginName = model.UserName; userItem.Email = model.Email; userItem.RealName = model.UserName; userItem.FirstQuestion = model.FirstQuestion; userItem.SecondQuestion = model.SecondQuestion; result = await _userManager.UpdateAsync(userItem); if (result.Succeeded) { var removeClaimsIdRst = await _userManager.RemoveClaimsAsync(userItem, new Claim[]{ new Claim(JwtClaimTypes.Name, oldName), new Claim(JwtClaimTypes.Email, oldEmail), }); if (removeClaimsIdRst.Succeeded) { var addClaimsIdRst = await _userManager.AddClaimsAsync(userItem, new Claim[]{ new Claim(JwtClaimTypes.Name, userItem.LoginName), new Claim(JwtClaimTypes.Email, userItem.Email), }); if (addClaimsIdRst.Succeeded) { return RedirectToLocal(returnUrl); } else { AddErrors(addClaimsIdRst); } } else { AddErrors(removeClaimsIdRst); } } } else { ModelState.AddModelError(string.Empty, $"{userItem?.UserName} no exist!"); } } else { ModelState.AddModelError(string.Empty, $"您无权修改该数据!"); } AddErrors(result); } // If we got this far, something failed, redisplay form return View(model); } [HttpPost] [Route("account/delete/{id}")] [Authorize(Policy = "SuperAdmin")] public async Task Delete(string id) { IdentityResult result = new IdentityResult(); if (ModelState.IsValid) { var userItem = _userManager.FindByIdAsync(id).Result; if (userItem != null) { userItem.tdIsDelete = true; result = await _userManager.UpdateAsync(userItem); if (result.Succeeded) { return Json(result); } } else { ModelState.AddModelError(string.Empty, $"{userItem?.UserName} no exist!"); } AddErrors(result); } return Json(result.Errors); } [HttpGet] [Route("account/confirm-email")] [AllowAnonymous] public async Task ConfirmEmail(string userId, string code) { if (userId == null || code == null) { return RedirectToAction(nameof(HomeController.Index), "Home"); } var user = await _userManager.FindByIdAsync(userId); if (user == null) { throw new ApplicationException($"Unable to load user with ID '{userId}'."); } var result = await _userManager.ConfirmEmailAsync(user, code); return View(result.Succeeded ? "ConfirmEmail" : "Error"); } [HttpGet] [Route("account/forgot-password")] [AllowAnonymous] public IActionResult ForgotPassword() { return View(); } [HttpPost] [Route("account/forgot-password")] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task ForgotPassword(ForgotPasswordViewModel model) { if (ModelState.IsValid) { var email = HttpContext.User.Claims.FirstOrDefault(c => c.Type == "email")?.Value; var roleName = HttpContext.User.Claims.FirstOrDefault(c => c.Type == "rolename")?.Value; if (email == model.Email || (roleName == "SuperAdmin")) { var user = await _userManager.FindByEmailAsync(model.Email); //if (user == null || !(await _userManager.IsEmailConfirmedAsync(user))) if (user == null) { // Don't reveal that the user does not exist or is not confirmed return RedirectToAction(nameof(ForgotPasswordConfirmation), new { ResetPassword = "邮箱不存在!" }); } // For more information on how to enable account confirmation and password reset please // visit https://go.microsoft.com/fwlink/?LinkID=532713 var code = await _userManager.GeneratePasswordResetTokenAsync(user); var accessCode = MD5Helper.MD5Encrypt32(user.Id + code); var callbackUrl = Url.ResetPasswordCallbackLink(user.Id.ToString(), code, Request.Scheme, accessCode); var ResetPassword = $"Please reset your password by clicking here: link"; return RedirectToAction(nameof(ForgotPasswordConfirmation), new { ResetPassword = ResetPassword }); } else if (!string.IsNullOrEmpty(model.FirstQuestion) && !string.IsNullOrEmpty(model.SecondQuestion)) { var user = _userManager.Users.FirstOrDefault(d => d.Email == model.Email && d.FirstQuestion == model.FirstQuestion && d.SecondQuestion == model.SecondQuestion); if (user == null) { return RedirectToAction(nameof(ForgotPasswordConfirmation), new { ResetPassword = "密保答案错误!" }); } var code = await _userManager.GeneratePasswordResetTokenAsync(user); var accessCode = MD5Helper.MD5Encrypt32(user.Id + code); var callbackUrl = Url.ResetPasswordCallbackLink(user.Id.ToString(), code, Request.Scheme, accessCode); var ResetPassword = $"Please reset your password by clicking here: link"; return RedirectToAction(nameof(ForgotPasswordConfirmation), new { ResetPassword = ResetPassword }); } else { var forgetPwdUrl = "https://github.com/anjoy8/Blog.IdentityServer/issues"; return RedirectToAction(nameof(AccessDenied), new { errorMsg = $"只能在登录状态下或者输入正确密保的情况下,修改密码!
如果忘记密码,请联系超级管理员手动重置:link,提Issue" }); } } // If we got this far, something failed, redisplay form return View(model); } [HttpGet] [Route("account/forgot-password-confirmation")] [AllowAnonymous] public IActionResult ForgotPasswordConfirmation(string ResetPassword) { ViewBag.ResetPassword = ResetPassword; return View(); } [HttpGet] [Route("account/reset-password")] [AllowAnonymous] public IActionResult ResetPassword(string code = null, string accessCode = null, string userId = "") { if (code == null || accessCode == null) { return RedirectToAction(nameof(AccessDenied), new { errorMsg = "code与accessCode必须都不能为空!" }); } var model = new ResetPasswordViewModel { Code = code, AccessCode = accessCode, userId = userId }; return View(model); } [HttpPost] [Route("account/reset-password")] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task ResetPassword(ResetPasswordViewModel model) { if (!ModelState.IsValid) { return View(model); } var user = await _userManager.FindByEmailAsync(model.Email); if (user == null) { // Don't reveal that the user does not exist return RedirectToAction(nameof(ResetPasswordConfirmation)); } // 防止篡改 var getAccessCode = MD5Helper.MD5Encrypt32(model.userId + model.Code); if (getAccessCode != model.AccessCode) { return RedirectToAction(nameof(AccessDenied), new { errorMsg = "随机码已被篡改!密码重置失败!" }); } if (user != null && user.Id.ToString() != model.userId) { return RedirectToAction(nameof(AccessDenied), new { errorMsg = "不能修改他人邮箱!密码重置失败!" }); } var result = await _userManager.ResetPasswordAsync(user, model.Code, model.Password); if (result.Succeeded) { return RedirectToAction(nameof(ResetPasswordConfirmation)); } AddErrors(result); return View(); } [HttpGet] [Route("account/reset-password-confirmation")] [AllowAnonymous] public IActionResult ResetPasswordConfirmation() { return View(); } [HttpGet] //[Route("account/access-denied")] public IActionResult AccessDenied(string errorMsg = "") { ViewBag.ErrorMsg = errorMsg; return View(); } private void AddErrors(IdentityResult result) { foreach (var error in result.Errors) { ModelState.AddModelError(string.Empty, error.Description); } } private IActionResult RedirectToLocal(string returnUrl) { if (Url.IsLocalUrl(returnUrl)) { return Redirect(returnUrl); } else { return RedirectToAction(nameof(HomeController.Index), "Home"); } } // Role Manager [HttpGet] [Route("account/Roleregister")] public IActionResult RoleRegister(string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; return View(); } [HttpPost] [Route("account/Roleregister")] [ValidateAntiForgeryToken] public async Task RoleRegister(RoleRegisterViewModel model, string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; IdentityResult result = new IdentityResult(); if (ModelState.IsValid) { var roleItem = _roleManager.FindByNameAsync(model.RoleName).Result; if (roleItem == null) { var role = new ApplicationRole { Name = model.RoleName }; result = await _roleManager.CreateAsync(role); if (result.Succeeded) { if (result.Succeeded) { // 可以直接登录 //await _signInManager.SignInAsync(user, isPersistent: false); return RedirectToLocal(returnUrl); } } } else { ModelState.AddModelError(string.Empty, $"{roleItem?.Name} already exists"); } AddErrors(result); } // If we got this far, something failed, redisplay form return View(model); } [HttpGet] [Route("account/Roles")] [Authorize] public IActionResult Roles(string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; var roles = _roleManager.Roles.Where(d => !d.IsDeleted).ToList(); return View(roles); } [HttpGet("{id}")] [Route("account/Roleedit/{id}")] [Authorize(Policy = "SuperAdmin")] public async Task RoleEdit(string id, string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; if (id == null) { return NotFound(); } var user = await _roleManager.FindByIdAsync(id); if (user == null) { return NotFound(); } return View(new RoleEditViewModel(user.Id.ToString(), user.Name)); } [HttpPost] [Route("account/Roleedit/{id}")] [ValidateAntiForgeryToken] [Authorize(Policy = "SuperAdmin")] public async Task RoleEdit(RoleEditViewModel model, string id, string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; IdentityResult result = new IdentityResult(); if (ModelState.IsValid) { var roleItem = _roleManager.FindByIdAsync(model.Id).Result; if (roleItem != null) { roleItem.Name = model.RoleName; result = await _roleManager.UpdateAsync(roleItem); if (result.Succeeded) { return RedirectToLocal(returnUrl); } } else { ModelState.AddModelError(string.Empty, $"{roleItem?.Name} no exist!"); } AddErrors(result); } // If we got this far, something failed, redisplay form return View(model); } [HttpPost] [Route("account/Roledelete/{id}")] [Authorize(Policy = "SuperAdmin")] public async Task RoleDelete(string id) { IdentityResult result = new IdentityResult(); if (ModelState.IsValid) { var roleItem = _roleManager.FindByIdAsync(id).Result; if (roleItem != null) { roleItem.IsDeleted = true; result = await _roleManager.UpdateAsync(roleItem); if (result.Succeeded) { return Json(result); } } else { ModelState.AddModelError(string.Empty, $"{roleItem?.Name} no exist!"); } AddErrors(result); } return Json(result.Errors); } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/AccountOptions.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System; namespace IdentityServer4.Quickstart.UI { public class AccountOptions { public static bool AllowLocalLogin = true; public static bool AllowRememberLogin = true; public static TimeSpan RememberMeLoginDuration = TimeSpan.FromDays(30); public static bool ShowLogoutPrompt = true; public static bool AutomaticRedirectAfterSignOut = true;//自动跳回原项目 // specify the Windows authentication scheme being used public static readonly string WindowsAuthenticationSchemeName = Microsoft.AspNetCore.Server.IISIntegration.IISDefaults.AuthenticationScheme; // if user uses windows auth, should we load the groups from windows public static bool IncludeWindowsGroups = false; public static string InvalidCredentialsErrorMessage = "Invalid username or password"; } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/EditViewModel.cs ================================================ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Security.Claims; namespace IdentityServer4.Quickstart.UI { public class EditViewModel { public EditViewModel() { } public EditViewModel(string Id, string Name, string LoginName, string Email, IList Claims, string FirstQuestion, string SecondQuestion) { this.Id = Id; this.LoginName = LoginName; this.Email = Email; this.UserName = Name; this.Claims = Claims; this.FirstQuestion = FirstQuestion; this.SecondQuestion = SecondQuestion; } public string Id { get; set; } [Required] [Display(Name = "昵称")] public string UserName { get; set; } [Required] [Display(Name = "登录名")] public string LoginName { get; set; } [Required] [EmailAddress] [Display(Name = "邮箱")] public string Email { get; set; } [Display(Name = "性别")] public int Sex { get; set; } = 0; [Display(Name = "生日")] public DateTime Birth { get; set; } = DateTime.Now; public IList Claims { get; set; } [Display(Name = "密保问题一:你喜欢的动漫?")] public string FirstQuestion { get; set; } [Display(Name = "密保问题二:你喜欢的名著?")] public string SecondQuestion { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/ExternalController.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using Blog.IdentityServer.Models; using IdentityModel; using IdentityServer4; using IdentityServer4.Events; using IdentityServer4.Models; using IdentityServer4.Services; using IdentityServer4.Stores; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; namespace IdentityServer4.Quickstart.UI { [SecurityHeaders] [AllowAnonymous] public class ExternalController : Controller { private readonly UserManager _userManager; private readonly SignInManager _signInManager; private readonly IIdentityServerInteractionService _interaction; private readonly IClientStore _clientStore; private readonly IEventService _events; private readonly ILogger _logger; public ExternalController( UserManager userManager, SignInManager signInManager, IIdentityServerInteractionService interaction, IClientStore clientStore, IEventService events, ILogger logger) { _userManager = userManager; _signInManager = signInManager; _interaction = interaction; _clientStore = clientStore; _events = events; _logger = logger; } /// /// initiate roundtrip to external authentication provider /// [HttpGet] public IActionResult Challenge(string scheme, string returnUrl) { if (string.IsNullOrEmpty(returnUrl)) returnUrl = "~/"; // validate returnUrl - either it is a valid OIDC URL or back to a local page if (Url.IsLocalUrl(returnUrl) == false && _interaction.IsValidReturnUrl(returnUrl) == false) { // user might have clicked on a malicious link - should be logged throw new Exception("invalid return URL"); } // start challenge and roundtrip the return URL and scheme var props = new AuthenticationProperties { RedirectUri = Url.Action(nameof(Callback)), Items = { { "returnUrl", returnUrl }, { "scheme", scheme }, } }; return Challenge(props, scheme); } /// /// Post processing of external authentication /// [HttpGet] public async Task Callback() { // read external identity from the temporary cookie var result = await HttpContext.AuthenticateAsync(IdentityServerConstants.ExternalCookieAuthenticationScheme); if (result?.Succeeded != true) { throw new Exception("External authentication error"); } if (_logger.IsEnabled(LogLevel.Debug)) { var externalClaims = result.Principal.Claims.Select(c => $"{c.Type}: {c.Value}"); _logger.LogDebug("External claims: {@claims}", externalClaims); } // lookup our user and external provider info var (user, provider, providerUserId, claims) = await FindUserFromExternalProviderAsync(result); if (user == null) { // this might be where you might initiate a custom workflow for user registration // in this sample we don't show how that would be done, as our sample implementation // simply auto-provisions new external user user = await AutoProvisionUserAsync(provider, providerUserId, claims); } // this allows us to collect any additional claims or properties // for the specific protocols used and store them in the local auth cookie. // this is typically used to store data needed for signout from those protocols. var additionalLocalClaims = new List(); var localSignInProps = new AuthenticationProperties(); ProcessLoginCallback(result, additionalLocalClaims, localSignInProps); // issue authentication cookie for user // we must issue the cookie maually, and can't use the SignInManager because // it doesn't expose an API to issue additional claims from the login workflow var principal = await _signInManager.CreateUserPrincipalAsync(user); additionalLocalClaims.AddRange(principal.Claims); var name = principal.FindFirst(JwtClaimTypes.Name)?.Value ?? user.Id.ToString(); var isuser = new IdentityServerUser(user.Id.ToString()) { DisplayName = name, IdentityProvider = provider, AdditionalClaims = additionalLocalClaims }; await HttpContext.SignInAsync(isuser, localSignInProps); // delete temporary cookie used during external authentication await HttpContext.SignOutAsync(IdentityServerConstants.ExternalCookieAuthenticationScheme); // retrieve return URL var returnUrl = result.Properties.Items["returnUrl"] ?? "~/"; // check if external login is in the context of an OIDC request var context = await _interaction.GetAuthorizationContextAsync(returnUrl); await _events.RaiseAsync(new UserLoginSuccessEvent(provider, providerUserId, user.Id.ToString(), name, true, context?.Client.ClientId)); if (context != null) { if (context.IsNativeClient()) { // The client is native, so this change in how to // return the response is for better UX for the end user. return this.LoadingPage("Redirect", returnUrl); } } return Redirect(returnUrl); } private async Task<(ApplicationUser user, string provider, string providerUserId, IEnumerable claims)> FindUserFromExternalProviderAsync(AuthenticateResult result) { var externalUser = result.Principal; // try to determine the unique id of the external user (issued by the provider) // the most common claim type for that are the sub claim and the NameIdentifier // depending on the external provider, some other claim type might be used var userIdClaim = externalUser.FindFirst(JwtClaimTypes.Subject) ?? externalUser.FindFirst(ClaimTypes.NameIdentifier) ?? throw new Exception("Unknown userid"); // remove the user id claim so we don't include it as an extra claim if/when we provision the user var claims = externalUser.Claims.ToList(); claims.Remove(userIdClaim); var provider = result.Properties.Items["scheme"]; var providerUserId = userIdClaim.Value; // find external user var user = await _userManager.FindByLoginAsync(provider, providerUserId); return (user, provider, providerUserId, claims); } private async Task AutoProvisionUserAsync(string provider, string providerUserId, IEnumerable claims) { // create a list of claims that we want to transfer into our store var filtered = new List(); // user's display name var name = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.Name)?.Value ?? claims.FirstOrDefault(x => x.Type == ClaimTypes.Name)?.Value; if (name != null) { filtered.Add(new Claim(JwtClaimTypes.Name, name)); } else { var first = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.GivenName)?.Value ?? claims.FirstOrDefault(x => x.Type == ClaimTypes.GivenName)?.Value; var last = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.FamilyName)?.Value ?? claims.FirstOrDefault(x => x.Type == ClaimTypes.Surname)?.Value; if (first != null && last != null) { filtered.Add(new Claim(JwtClaimTypes.Name, first + " " + last)); } else if (first != null) { filtered.Add(new Claim(JwtClaimTypes.Name, first)); } else if (last != null) { filtered.Add(new Claim(JwtClaimTypes.Name, last)); } } // email var email = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.Email)?.Value ?? claims.FirstOrDefault(x => x.Type == ClaimTypes.Email)?.Value; if (email != null) { filtered.Add(new Claim(JwtClaimTypes.Email, email)); } var user = new ApplicationUser { UserName = Guid.NewGuid().ToString(), }; var identityResult = await _userManager.CreateAsync(user); if (!identityResult.Succeeded) throw new Exception(identityResult.Errors.First().Description); if (filtered.Any()) { identityResult = await _userManager.AddClaimsAsync(user, filtered); if (!identityResult.Succeeded) throw new Exception(identityResult.Errors.First().Description); } identityResult = await _userManager.AddLoginAsync(user, new UserLoginInfo(provider, providerUserId, provider)); if (!identityResult.Succeeded) throw new Exception(identityResult.Errors.First().Description); return user; } // if the external login is OIDC-based, there are certain things we need to preserve to make logout work // this will be different for WS-Fed, SAML2p or other protocols private void ProcessLoginCallback(AuthenticateResult externalResult, List localClaims, AuthenticationProperties localSignInProps) { // if the external system sent a session id claim, copy it over // so we can use it for single sign-out var sid = externalResult.Principal.Claims.FirstOrDefault(x => x.Type == JwtClaimTypes.SessionId); if (sid != null) { localClaims.Add(new Claim(JwtClaimTypes.SessionId, sid.Value)); } // if the external provider issued an id_token, we'll keep it for signout var idToken = externalResult.Properties.GetTokenValue("id_token"); if (idToken != null) { localSignInProps.StoreTokens(new[] { new AuthenticationToken { Name = "id_token", Value = idToken } }); } } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/ExternalProvider.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace IdentityServer4.Quickstart.UI { public class ExternalProvider { public string DisplayName { get; set; } public string AuthenticationScheme { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/ForgotPasswordViewModel.cs ================================================ using System.ComponentModel.DataAnnotations; namespace IdentityServer4.Quickstart.UI { public class ForgotPasswordViewModel { [Required] [EmailAddress] public string Email { get; set; } [Display(Name = "密保问题一:你喜欢的动漫?")] public string FirstQuestion { get; set; } [Display(Name = "密保问题二:你喜欢的名著?")] public string SecondQuestion { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/LoggedOutViewModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace IdentityServer4.Quickstart.UI { public class LoggedOutViewModel { public string PostLogoutRedirectUri { get; set; } public string ClientName { get; set; } public string SignOutIframeUrl { get; set; } public bool AutomaticRedirectAfterSignOut { get; set; } = false; public string LogoutId { get; set; } public bool TriggerExternalSignout => ExternalAuthenticationScheme != null; public string ExternalAuthenticationScheme { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/LoginInputModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System.ComponentModel.DataAnnotations; namespace IdentityServer4.Quickstart.UI { public class LoginInputModel { [Required] public string Username { get; set; } [Required] public string Password { get; set; } public bool RememberLogin { get; set; } public string ReturnUrl { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/LoginViewModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System; using System.Collections.Generic; using System.Linq; namespace IdentityServer4.Quickstart.UI { public class LoginViewModel : LoginInputModel { public bool AllowRememberLogin { get; set; } = true; public bool EnableLocalLogin { get; set; } = true; public IEnumerable ExternalProviders { get; set; } = Enumerable.Empty(); public IEnumerable VisibleExternalProviders => ExternalProviders.Where(x => !String.IsNullOrWhiteSpace(x.DisplayName)); public bool IsExternalLoginOnly => EnableLocalLogin == false && ExternalProviders?.Count() == 1; public string ExternalLoginScheme => IsExternalLoginOnly ? ExternalProviders?.SingleOrDefault()?.AuthenticationScheme : null; } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/LogoutInputModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace IdentityServer4.Quickstart.UI { public class LogoutInputModel { public string LogoutId { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/LogoutViewModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace IdentityServer4.Quickstart.UI { public class LogoutViewModel : LogoutInputModel { public bool ShowLogoutPrompt { get; set; } = true; } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/RedirectViewModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace IdentityServer4.Quickstart.UI { public class RedirectViewModel { public string RedirectUrl { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/RegisterViewModel.cs ================================================ using System; using System.ComponentModel.DataAnnotations; namespace IdentityServer4.Quickstart.UI { public class RegisterViewModel { [Required] [Display(Name = "昵称")] public string RealName { get; set; } [Required] [Display(Name = "登录名")] public string LoginName { get; set; } [Required] [EmailAddress] [Display(Name = "邮箱")] public string Email { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "密码")] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "确认密码")] [Compare("Password", ErrorMessage = "The 密码 and 确认密码 do not match.")] public string ConfirmPassword { get; set; } [Required] [Display(Name = "密保问题一:你喜欢的动漫?")] public string FirstQuestion { get; set; } [Required] [Display(Name = "密保问题二:你喜欢的名著?")] public string SecondQuestion { get; set; } [Display(Name = "性别")] public int Sex { get; set; } = 0; [Display(Name = "生日")] public DateTime Birth { get; set; } = DateTime.Now; } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/ResetPasswordViewModel.cs ================================================ using System.ComponentModel.DataAnnotations; namespace IdentityServer4.Quickstart.UI { public class ResetPasswordViewModel { [Required] public string userId { get; set; } [Required] [EmailAddress] public string Email { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm password")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } public string Code { get; set; } public string AccessCode { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/RoleEditViewModel.cs ================================================ using System; using System.ComponentModel.DataAnnotations; namespace IdentityServer4.Quickstart.UI { public class RoleEditViewModel { public RoleEditViewModel() { } public RoleEditViewModel(string Id, string Name) { this.Id = Id; this.RoleName = Name; } public string Id { get; set; } [Required] [Display(Name = "角色名")] public string RoleName { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/RoleRegisterViewModel.cs ================================================ using System; using System.ComponentModel.DataAnnotations; namespace IdentityServer4.Quickstart.UI { public class RoleRegisterViewModel { [Required] [Display(Name = "角色名")] public string RoleName { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Account/UrlHelperExtensions.cs ================================================ using Microsoft.AspNetCore.Mvc; namespace IdentityServer4.Quickstart.UI { public static class UrlHelperExtensions { public static string EmailConfirmationLink(this IUrlHelper urlHelper, string userId, string code, string scheme) { return urlHelper.Action( action: nameof(AccountController.ConfirmEmail), controller: "Account", values: new { userId, code }, protocol: scheme); } public static string ResetPasswordCallbackLink(this IUrlHelper urlHelper, string userId, string code, string scheme, string accessCode = "") { return urlHelper.Action( action: nameof(AccountController.ResetPassword), controller: "Account", values: new { userId, code, accessCode }, protocol: scheme); } } } ================================================ FILE: Blog.IdentityServer/Controllers/ApiResource/ApiResourceDto.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Blog.IdentityServer.Controllers.ApiResource { public class ApiResourceDto { public int Id { get; set; } public string Name { get; set; } public string DisplayName { get; set; } public string Description { get; set; } public string UserClaims { get; set; } public string Scopes { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/ApiResource/ApiResourcesManager.cs ================================================ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Blog.IdentityServer.Models; using IdentityServer4.EntityFramework.DbContexts; using IdentityServer4.EntityFramework.Mappers; using IdentityServer4.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; namespace Blog.IdentityServer.Controllers.ApiResource { [Route("[controller]/[action]")] [ApiController] public class ApiResourcesManager : Controller { private readonly ConfigurationDbContext _configurationDbContext; public ApiResourcesManager(ConfigurationDbContext configurationDbContext) { _configurationDbContext = configurationDbContext; } /// /// 数据列表页 /// /// [HttpGet] [Authorize] public async Task Index() { return View(await _configurationDbContext.ApiResources .Include(d => d.UserClaims) .Include(d => d.Scopes) .ToListAsync()); } /// /// 数据修改页 /// /// /// [HttpGet] [Authorize(Policy = "SuperAdmin")] public IActionResult CreateOrEdit(int id) { ViewBag.ApiResourceId = id; return View(); } [HttpGet] [Authorize(Policy = "SuperAdmin")] public async Task> GetDataById(int id = 0) { var model = (await _configurationDbContext.ApiResources .Include(d => d.UserClaims) .Include(d => d.Scopes) .ToListAsync()).FirstOrDefault(d => d.Id == id).ToModel(); var apiResourceDto = new ApiResourceDto(); if (model != null) { apiResourceDto = new ApiResourceDto() { Name = model?.Name, DisplayName = model?.DisplayName, Description = model?.Description, UserClaims = string.Join(",", model?.UserClaims), Scopes = string.Join(",", model?.Scopes), }; } return new MessageModel() { success = true, msg = "获取成功", response = apiResourceDto }; } [HttpPost] [Authorize(Policy = "SuperAdmin")] public async Task> SaveData(ApiResourceDto request) { if (request != null && request.Id == 0) { IdentityServer4.Models.ApiResource apiResource = new IdentityServer4.Models.ApiResource() { Name = request?.Name, DisplayName = request?.DisplayName, Description = request?.Description, Enabled = true, UserClaims = request?.UserClaims?.Split(","), Scopes = request?.Scopes?.Split(","), }; var result = (await _configurationDbContext.ApiResources.AddAsync(apiResource.ToEntity())); await _configurationDbContext.SaveChangesAsync(); } if (request != null && request.Id > 0) { var modelEF = (await _configurationDbContext.ApiResources .Include(d => d.UserClaims) .Include(d => d.Scopes) .ToListAsync()).FirstOrDefault(d => d.Id == request.Id); modelEF.Name = request?.Name; modelEF.DisplayName = request?.DisplayName; modelEF.Description = request?.Description; { var apiResourceClaim = new List(); if (!string.IsNullOrEmpty(request?.UserClaims)) { request?.UserClaims.Split(",").Where(s => s != "" && s != null).ToList().ForEach(s => { apiResourceClaim.Add(new IdentityServer4.EntityFramework.Entities.ApiResourceClaim() { ApiResource = modelEF, ApiResourceId = modelEF.Id, Type = s }); }); modelEF.UserClaims = apiResourceClaim; } } var apiResourceScopes = new List(); if (!string.IsNullOrEmpty(request?.Scopes)) { request?.Scopes.Split(",").Where(s => s != "" && s != null).ToList().ForEach(s => { apiResourceScopes.Add(new IdentityServer4.EntityFramework.Entities.ApiResourceScope() { ApiResource = modelEF, ApiResourceId = modelEF.Id, Scope = s }); }); modelEF.Scopes = apiResourceScopes; } var result = (_configurationDbContext.ApiResources.Update(modelEF)); await _configurationDbContext.SaveChangesAsync(); } return new MessageModel() { success = true, msg = "添加成功", }; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Client/ClientDto.cs ================================================ namespace Blog.IdentityServer.Controllers.Client { public class ClientDto { public int id { get; set; } public string ClientId { get; set; } public string ClientName { get; set; } public string ClientSecrets { get; set; } public string Description { get; set; } public string AllowAccessTokensViaBrowser { get; set; } public string AllowedGrantTypes { get; set; } public string AllowedScopes { get; set; } public string AllowedCorsOrigins { get; set; } public string RedirectUris { get; set; } public string PostLogoutRedirectUris { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Client/ClientsManagerController.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Blog.Core.Common.Helper; using Blog.IdentityServer.Models; using IdentityServer4; using IdentityServer4.EntityFramework.DbContexts; using IdentityServer4.EntityFramework.Mappers; using IdentityServer4.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using static IdentityModel.OidcConstants; namespace Blog.IdentityServer.Controllers.Client { [Route("[controller]/[action]")] [ApiController] public class ClientsManagerController : Controller { private readonly ConfigurationDbContext _configurationDbContext; public ClientsManagerController(ConfigurationDbContext configurationDbContext) { _configurationDbContext = configurationDbContext; } /// /// 数据列表页 /// /// [HttpGet] [Authorize] public async Task Index() { return View(await _configurationDbContext.Clients .Include(d => d.AllowedGrantTypes) .Include(d => d.AllowedScopes) .Include(d => d.AllowedCorsOrigins) .Include(d => d.RedirectUris) .Include(d => d.PostLogoutRedirectUris) .ToListAsync()); } /// /// 数据修改页 /// /// /// [HttpGet] [Authorize(Policy = "SuperAdmin")] public IActionResult CreateOrEdit(int id) { ViewBag.ClientId = id; return View(); } [HttpGet] [Authorize(Policy = "SuperAdmin")] public async Task> GetDataById(int id = 0) { var model = (await _configurationDbContext.Clients .Include(d => d.AllowedGrantTypes) .Include(d => d.AllowedScopes) .Include(d => d.AllowedCorsOrigins) .Include(d => d.RedirectUris) .Include(d => d.PostLogoutRedirectUris) .Include(d => d.ClientSecrets) .ToListAsync()).FirstOrDefault(d => d.Id == id).ToModel(); var clientDto = new ClientDto(); if (model != null) { clientDto = new ClientDto() { ClientId = model?.ClientId, ClientName = model?.ClientName, Description = model?.Description, AllowAccessTokensViaBrowser = (model?.AllowAccessTokensViaBrowser).ObjToString(), AllowedCorsOrigins = string.Join(",", model?.AllowedCorsOrigins), AllowedGrantTypes = string.Join(",", model?.AllowedGrantTypes), AllowedScopes = string.Join(",", model?.AllowedScopes), PostLogoutRedirectUris = string.Join(",", model?.PostLogoutRedirectUris), RedirectUris = string.Join(",", model?.RedirectUris), ClientSecrets = string.Join(",", model?.ClientSecrets.Select(d => d.Value)), }; } return new MessageModel() { success = true, msg = "获取成功", response = clientDto }; } [HttpPost] [Authorize(Policy = "SuperAdmin")] public async Task> SaveData(ClientDto request) { if (request != null && request.id == 0) { IdentityServer4.Models.Client client = new IdentityServer4.Models.Client() { ClientId = request?.ClientId, ClientName = request?.ClientName, Description = request?.Description, AllowAccessTokensViaBrowser = (request?.AllowAccessTokensViaBrowser).ObjToBool(), AllowedCorsOrigins = request?.AllowedCorsOrigins?.Split(","), AllowedGrantTypes = request?.AllowedGrantTypes?.Split(","), AllowedScopes = request?.AllowedScopes?.Split(","), PostLogoutRedirectUris = request?.PostLogoutRedirectUris?.Split(","), RedirectUris = request?.RedirectUris?.Split(","), }; if (!string.IsNullOrEmpty(request.ClientSecrets)) { client.ClientSecrets = new List() { new Secret(request.ClientSecrets.Sha256()) }; } var result = (await _configurationDbContext.Clients.AddAsync(client.ToEntity())); await _configurationDbContext.SaveChangesAsync(); } if (request != null && request.id > 0) { var modelEF = (await _configurationDbContext.Clients .Include(d => d.AllowedGrantTypes) .Include(d => d.AllowedScopes) .Include(d => d.AllowedCorsOrigins) .Include(d => d.RedirectUris) .Include(d => d.PostLogoutRedirectUris) .ToListAsync()).FirstOrDefault(d => d.Id == request.id); modelEF.ClientId = request?.ClientId; modelEF.ClientName = request?.ClientName; modelEF.Description = request?.Description; modelEF.AllowAccessTokensViaBrowser = (request?.AllowAccessTokensViaBrowser).ObjToBool(); var AllowedCorsOrigins = new List(); if (!string.IsNullOrEmpty(request?.AllowedCorsOrigins)) { request?.AllowedCorsOrigins.Split(",").Where(s => s != "" && s != null).ToList().ForEach(s => { AllowedCorsOrigins.Add(new IdentityServer4.EntityFramework.Entities.ClientCorsOrigin() { Client = modelEF, ClientId = modelEF.Id, Origin = s }); }); modelEF.AllowedCorsOrigins = AllowedCorsOrigins; } var AllowedGrantTypes = new List(); if (!string.IsNullOrEmpty(request?.AllowedGrantTypes)) { request?.AllowedGrantTypes.Split(",").Where(s => s != "" && s != null).ToList().ForEach(s => { AllowedGrantTypes.Add(new IdentityServer4.EntityFramework.Entities.ClientGrantType() { Client = modelEF, ClientId = modelEF.Id, GrantType = s }); }); modelEF.AllowedGrantTypes = AllowedGrantTypes; } var AllowedScopes = new List(); if (!string.IsNullOrEmpty(request?.AllowedScopes)) { request?.AllowedScopes.Split(",").Where(s => s != "" && s != null).ToList().ForEach(s => { AllowedScopes.Add(new IdentityServer4.EntityFramework.Entities.ClientScope() { Client = modelEF, ClientId = modelEF.Id, Scope = s }); }); modelEF.AllowedScopes = AllowedScopes; } var PostLogoutRedirectUris = new List(); if (!string.IsNullOrEmpty(request?.PostLogoutRedirectUris)) { request?.PostLogoutRedirectUris.Split(",").Where(s => s != "" && s != null).ToList().ForEach(s => { PostLogoutRedirectUris.Add(new IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri() { Client = modelEF, ClientId = modelEF.Id, PostLogoutRedirectUri = s }); }); modelEF.PostLogoutRedirectUris = PostLogoutRedirectUris; } var RedirectUris = new List(); if (!string.IsNullOrEmpty(request?.RedirectUris)) { request?.RedirectUris.Split(",").Where(s => s != "" && s != null).ToList().ForEach(s => { RedirectUris.Add(new IdentityServer4.EntityFramework.Entities.ClientRedirectUri() { Client = modelEF, ClientId = modelEF.Id, RedirectUri = s }); }); modelEF.RedirectUris = RedirectUris; } var result = (_configurationDbContext.Clients.Update(modelEF)); await _configurationDbContext.SaveChangesAsync(); } return new MessageModel() { success = true, msg = "添加成功", }; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Consent/ConsentController.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityServer4.Events; using IdentityServer4.Models; using IdentityServer4.Services; using IdentityServer4.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; using IdentityServer4.Validation; using System.Collections.Generic; using System; namespace IdentityServer4.Quickstart.UI { /// /// This controller processes the consent UI /// [SecurityHeaders] [Authorize] public class ConsentController : Controller { private readonly IIdentityServerInteractionService _interaction; private readonly IEventService _events; private readonly ILogger _logger; public ConsentController( IIdentityServerInteractionService interaction, IEventService events, ILogger logger) { _interaction = interaction; _events = events; _logger = logger; } /// /// Shows the consent screen /// /// /// [HttpGet] public async Task Index(string returnUrl) { var vm = await BuildViewModelAsync(returnUrl); if (vm != null) { return View("Index", vm); } return View("Error"); } /// /// Handles the consent screen postback /// [HttpPost] [ValidateAntiForgeryToken] public async Task Index(ConsentInputModel model) { var result = await ProcessConsent(model); if (result.IsRedirect) { var context = await _interaction.GetAuthorizationContextAsync(model.ReturnUrl); if (context?.IsNativeClient() == true) { // The client is native, so this change in how to // return the response is for better UX for the end user. return this.LoadingPage("Redirect", result.RedirectUri); } return Redirect(result.RedirectUri); } if (result.HasValidationError) { ModelState.AddModelError(string.Empty, result.ValidationError); } if (result.ShowView) { return View("Index", result.ViewModel); } return View("Error"); } /*****************************************/ /* helper APIs for the ConsentController */ /*****************************************/ private async Task ProcessConsent(ConsentInputModel model) { var result = new ProcessConsentResult(); // validate return url is still valid var request = await _interaction.GetAuthorizationContextAsync(model.ReturnUrl); if (request == null) return result; ConsentResponse grantedConsent = null; // user clicked 'no' - send back the standard 'access_denied' response if (model?.Button == "no") { grantedConsent = new ConsentResponse { Error = AuthorizationError.AccessDenied }; // emit event await _events.RaiseAsync(new ConsentDeniedEvent(User.GetSubjectId(), request.Client.ClientId, request.ValidatedResources.RawScopeValues)); } // user clicked 'yes' - validate the data else if (model?.Button == "yes") { // if the user consented to some scope, build the response model if (model.ScopesConsented != null && model.ScopesConsented.Any()) { var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse { RememberConsent = model.RememberConsent, ScopesValuesConsented = scopes.ToArray(), Description = model.Description }; // emit event await _events.RaiseAsync(new ConsentGrantedEvent(User.GetSubjectId(), request.Client.ClientId, request.ValidatedResources.RawScopeValues, grantedConsent.ScopesValuesConsented, grantedConsent.RememberConsent)); } else { result.ValidationError = ConsentOptions.MustChooseOneErrorMessage; } } else { result.ValidationError = ConsentOptions.InvalidSelectionErrorMessage; } if (grantedConsent != null) { // communicate outcome of consent back to identityserver await _interaction.GrantConsentAsync(request, grantedConsent); // indicate that's it ok to redirect back to authorization endpoint result.RedirectUri = model.ReturnUrl; result.Client = request.Client; } else { // we need to redisplay the consent UI result.ViewModel = await BuildViewModelAsync(model.ReturnUrl, model); } return result; } private async Task BuildViewModelAsync(string returnUrl, ConsentInputModel model = null) { var request = await _interaction.GetAuthorizationContextAsync(returnUrl); if (request != null) { return CreateConsentViewModel(model, returnUrl, request); } else { _logger.LogError("No consent request matching request: {0}", returnUrl); } return null; } private ConsentViewModel CreateConsentViewModel( ConsentInputModel model, string returnUrl, AuthorizationRequest request) { var vm = new ConsentViewModel { RememberConsent = model?.RememberConsent ?? true, ScopesConsented = model?.ScopesConsented ?? Enumerable.Empty(), Description = model?.Description, ReturnUrl = returnUrl, ClientName = request.Client.ClientName ?? request.Client.ClientId, ClientUrl = request.Client.ClientUri, ClientLogoUrl = request.Client.LogoUri, AllowRememberConsent = request.Client.AllowRememberConsent }; vm.IdentityScopes = request.ValidatedResources.Resources.IdentityResources.Select(x => CreateScopeViewModel(x, vm.ScopesConsented.Contains(x.Name) || model == null)).ToArray(); var apiScopes = new List(); foreach (var parsedScope in request.ValidatedResources.ParsedScopes) { var apiScope = request.ValidatedResources.Resources.FindApiScope(parsedScope.ParsedName); if (apiScope != null) { var scopeVm = CreateScopeViewModel(parsedScope, apiScope, vm.ScopesConsented.Contains(parsedScope.RawValue) || model == null); apiScopes.Add(scopeVm); } } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; return vm; } private ScopeViewModel CreateScopeViewModel(IdentityResource identity, bool check) { return new ScopeViewModel { Value = identity.Name, DisplayName = identity.DisplayName ?? identity.Name, Description = identity.Description, Emphasize = identity.Emphasize, Required = identity.Required, Checked = check || identity.Required }; } public ScopeViewModel CreateScopeViewModel(ParsedScopeValue parsedScopeValue, ApiScope apiScope, bool check) { var displayName = apiScope.DisplayName ?? apiScope.Name; if (!String.IsNullOrWhiteSpace(parsedScopeValue.ParsedParameter)) { displayName += ":" + parsedScopeValue.ParsedParameter; } return new ScopeViewModel { Value = parsedScopeValue.RawValue, DisplayName = displayName, Description = apiScope.Description, Emphasize = apiScope.Emphasize, Required = apiScope.Required, Checked = check || apiScope.Required }; } private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, Checked = check }; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Consent/ConsentInputModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System.Collections.Generic; namespace IdentityServer4.Quickstart.UI { public class ConsentInputModel { public string Button { get; set; } public IEnumerable ScopesConsented { get; set; } public bool RememberConsent { get; set; } public string ReturnUrl { get; set; } public string Description { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Consent/ConsentOptions.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace IdentityServer4.Quickstart.UI { public class ConsentOptions { public static bool EnableOfflineAccess = true; public static string OfflineAccessDisplayName = "Offline Access"; public static string OfflineAccessDescription = "Access to your applications and resources, even when you are offline"; public static readonly string MustChooseOneErrorMessage = "You must pick at least one permission"; public static readonly string InvalidSelectionErrorMessage = "Invalid selection"; } } ================================================ FILE: Blog.IdentityServer/Controllers/Consent/ConsentViewModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System.Collections.Generic; namespace IdentityServer4.Quickstart.UI { public class ConsentViewModel : ConsentInputModel { public string ClientName { get; set; } public string ClientUrl { get; set; } public string ClientLogoUrl { get; set; } public bool AllowRememberConsent { get; set; } public IEnumerable IdentityScopes { get; set; } public IEnumerable ApiScopes { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Consent/ProcessConsentResult.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityServer4.Models; namespace IdentityServer4.Quickstart.UI { public class ProcessConsentResult { public bool IsRedirect => RedirectUri != null; public string RedirectUri { get; set; } public Client Client { get; set; } public bool ShowView => ViewModel != null; public ConsentViewModel ViewModel { get; set; } public bool HasValidationError => ValidationError != null; public string ValidationError { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Consent/ScopeViewModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace IdentityServer4.Quickstart.UI { public class ScopeViewModel { public string Value { get; set; } public string DisplayName { get; set; } public string Description { get; set; } public bool Emphasize { get; set; } public bool Required { get; set; } public bool Checked { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Device/DeviceAuthorizationInputModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace IdentityServer4.Quickstart.UI.Device { public class DeviceAuthorizationInputModel : ConsentInputModel { public string UserCode { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Device/DeviceAuthorizationViewModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. namespace IdentityServer4.Quickstart.UI.Device { public class DeviceAuthorizationViewModel : ConsentViewModel { public string UserCode { get; set; } public bool ConfirmUserCode { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Device/DeviceController.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using IdentityServer4.Configuration; using IdentityServer4.Events; using IdentityServer4.Extensions; using IdentityServer4.Models; using IdentityServer4.Services; using IdentityServer4.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace IdentityServer4.Quickstart.UI.Device { [Authorize] [SecurityHeaders] public class DeviceController : Controller { private readonly IDeviceFlowInteractionService _interaction; private readonly IEventService _events; private readonly IOptions _options; private readonly ILogger _logger; public DeviceController( IDeviceFlowInteractionService interaction, IEventService eventService, IOptions options, ILogger logger) { _interaction = interaction; _events = eventService; _options = options; _logger = logger; } [HttpGet] public async Task Index() { string userCodeParamName = _options.Value.UserInteraction.DeviceVerificationUserCodeParameter; string userCode = Request.Query[userCodeParamName]; if (string.IsNullOrWhiteSpace(userCode)) return View("UserCodeCapture"); var vm = await BuildViewModelAsync(userCode); if (vm == null) return View("Error"); vm.ConfirmUserCode = true; return View("UserCodeConfirmation", vm); } [HttpPost] [ValidateAntiForgeryToken] public async Task UserCodeCapture(string userCode) { var vm = await BuildViewModelAsync(userCode); if (vm == null) return View("Error"); return View("UserCodeConfirmation", vm); } [HttpPost] [ValidateAntiForgeryToken] public async Task Callback(DeviceAuthorizationInputModel model) { if (model == null) throw new ArgumentNullException(nameof(model)); var result = await ProcessConsent(model); if (result.HasValidationError) return View("Error"); return View("Success"); } private async Task ProcessConsent(DeviceAuthorizationInputModel model) { var result = new ProcessConsentResult(); var request = await _interaction.GetAuthorizationContextAsync(model.UserCode); if (request == null) return result; ConsentResponse grantedConsent = null; // user clicked 'no' - send back the standard 'access_denied' response if (model.Button == "no") { grantedConsent = new ConsentResponse { Error = AuthorizationError.AccessDenied }; // emit event await _events.RaiseAsync(new ConsentDeniedEvent(User.GetSubjectId(), request.Client.ClientId, request.ValidatedResources.RawScopeValues)); } // user clicked 'yes' - validate the data else if (model.Button == "yes") { // if the user consented to some scope, build the response model if (model.ScopesConsented != null && model.ScopesConsented.Any()) { var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse { RememberConsent = model.RememberConsent, ScopesValuesConsented = scopes.ToArray(), Description = model.Description }; // emit event await _events.RaiseAsync(new ConsentGrantedEvent(User.GetSubjectId(), request.Client.ClientId, request.ValidatedResources.RawScopeValues, grantedConsent.ScopesValuesConsented, grantedConsent.RememberConsent)); } else { result.ValidationError = ConsentOptions.MustChooseOneErrorMessage; } } else { result.ValidationError = ConsentOptions.InvalidSelectionErrorMessage; } if (grantedConsent != null) { // communicate outcome of consent back to identityserver await _interaction.HandleRequestAsync(model.UserCode, grantedConsent); // indicate that's it ok to redirect back to authorization endpoint result.RedirectUri = model.ReturnUrl; result.Client = request.Client; } else { // we need to redisplay the consent UI result.ViewModel = await BuildViewModelAsync(model.UserCode, model); } return result; } private async Task BuildViewModelAsync(string userCode, DeviceAuthorizationInputModel model = null) { var request = await _interaction.GetAuthorizationContextAsync(userCode); if (request != null) { return CreateConsentViewModel(userCode, model, request); } return null; } private DeviceAuthorizationViewModel CreateConsentViewModel(string userCode, DeviceAuthorizationInputModel model, DeviceFlowAuthorizationRequest request) { var vm = new DeviceAuthorizationViewModel { UserCode = userCode, Description = model?.Description, RememberConsent = model?.RememberConsent ?? true, ScopesConsented = model?.ScopesConsented ?? Enumerable.Empty(), ClientName = request.Client.ClientName ?? request.Client.ClientId, ClientUrl = request.Client.ClientUri, ClientLogoUrl = request.Client.LogoUri, AllowRememberConsent = request.Client.AllowRememberConsent }; vm.IdentityScopes = request.ValidatedResources.Resources.IdentityResources.Select(x => CreateScopeViewModel(x, vm.ScopesConsented.Contains(x.Name) || model == null)).ToArray(); var apiScopes = new List(); foreach (var parsedScope in request.ValidatedResources.ParsedScopes) { var apiScope = request.ValidatedResources.Resources.FindApiScope(parsedScope.ParsedName); if (apiScope != null) { var scopeVm = CreateScopeViewModel(parsedScope, apiScope, vm.ScopesConsented.Contains(parsedScope.RawValue) || model == null); apiScopes.Add(scopeVm); } } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; return vm; } private ScopeViewModel CreateScopeViewModel(IdentityResource identity, bool check) { return new ScopeViewModel { Value = identity.Name, DisplayName = identity.DisplayName ?? identity.Name, Description = identity.Description, Emphasize = identity.Emphasize, Required = identity.Required, Checked = check || identity.Required }; } public ScopeViewModel CreateScopeViewModel(ParsedScopeValue parsedScopeValue, ApiScope apiScope, bool check) { return new ScopeViewModel { Value = parsedScopeValue.RawValue, // todo: use the parsed scope value in the display? DisplayName = apiScope.DisplayName ?? apiScope.Name, Description = apiScope.Description, Emphasize = apiScope.Emphasize, Required = apiScope.Required, Checked = check || apiScope.Required }; } private ScopeViewModel GetOfflineAccessScope(bool check) { return new ScopeViewModel { Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, Checked = check }; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Diagnostics/DiagnosticsController.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace IdentityServer4.Quickstart.UI { [SecurityHeaders] [Authorize] public class DiagnosticsController : Controller { public async Task Index() { var localAddresses = new string[] { "127.0.0.1", "::1", HttpContext.Connection.LocalIpAddress.ToString() }; if (!localAddresses.Contains(HttpContext.Connection.RemoteIpAddress.ToString())) { return NotFound(); } var model = new DiagnosticsViewModel(await HttpContext.AuthenticateAsync()); return View(model); } } } ================================================ FILE: Blog.IdentityServer/Controllers/Diagnostics/DiagnosticsViewModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityModel; using Microsoft.AspNetCore.Authentication; using Newtonsoft.Json; using System.Collections.Generic; using System.Text; namespace IdentityServer4.Quickstart.UI { public class DiagnosticsViewModel { public DiagnosticsViewModel(AuthenticateResult result) { AuthenticateResult = result; if (result.Properties.Items.ContainsKey("client_list")) { var encoded = result.Properties.Items["client_list"]; var bytes = Base64Url.Decode(encoded); var value = Encoding.UTF8.GetString(bytes); Clients = JsonConvert.DeserializeObject(value); } } public AuthenticateResult AuthenticateResult { get; } public IEnumerable Clients { get; } = new List(); } } ================================================ FILE: Blog.IdentityServer/Controllers/Extensions.cs ================================================ using System; using System.Threading.Tasks; using IdentityServer4.Models; using IdentityServer4.Stores; using Microsoft.AspNetCore.Mvc; namespace IdentityServer4.Quickstart.UI { public static class Extensions { /// /// Determines whether the client is configured to use PKCE. /// /// The store. /// The client identifier. /// public static async Task IsPkceClientAsync(this IClientStore store, string client_id) { if (!string.IsNullOrWhiteSpace(client_id)) { var client = await store.FindEnabledClientByIdAsync(client_id); return client?.RequirePkce == true; } return false; } /// /// Checks if the redirect URI is for a native client. /// /// public static bool IsNativeClient(this AuthorizationRequest context) { return !context.RedirectUri.StartsWith("https", StringComparison.Ordinal) && !context.RedirectUri.StartsWith("http", StringComparison.Ordinal); } public static IActionResult LoadingPage(this Controller controller, string viewName, string redirectUri) { controller.HttpContext.Response.StatusCode = 200; controller.HttpContext.Response.Headers["Location"] = ""; return controller.View(viewName, new RedirectViewModel { RedirectUrl = redirectUri }); } } } ================================================ FILE: Blog.IdentityServer/Controllers/Grants/GrantsController.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityServer4.Services; using IdentityServer4.Stores; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using IdentityServer4.Events; using IdentityServer4.Extensions; namespace IdentityServer4.Quickstart.UI { /// /// This sample controller allows a user to revoke grants given to clients /// [SecurityHeaders] [Authorize] public class GrantsController : Controller { private readonly IIdentityServerInteractionService _interaction; private readonly IClientStore _clients; private readonly IResourceStore _resources; private readonly IEventService _events; public GrantsController(IIdentityServerInteractionService interaction, IClientStore clients, IResourceStore resources, IEventService events) { _interaction = interaction; _clients = clients; _resources = resources; _events = events; } /// /// Show list of grants /// [HttpGet] public async Task Index() { return View("Index", await BuildViewModelAsync()); } /// /// Handle postback to revoke a client /// [HttpPost] [ValidateAntiForgeryToken] public async Task Revoke(string clientId) { await _interaction.RevokeUserConsentAsync(clientId); await _events.RaiseAsync(new GrantsRevokedEvent(User.GetSubjectId(), clientId)); return RedirectToAction("Index"); } private async Task BuildViewModelAsync() { var grants = await _interaction.GetAllUserGrantsAsync(); var list = new List(); foreach (var grant in grants) { var client = await _clients.FindClientByIdAsync(grant.ClientId); if (client != null) { var resources = await _resources.FindResourcesByScopeAsync(grant.Scopes); var item = new GrantViewModel() { ClientId = client.ClientId, ClientName = client.ClientName ?? client.ClientId, ClientLogoUrl = client.LogoUri, ClientUrl = client.ClientUri, Description = grant.Description, Created = grant.CreationTime, Expires = grant.Expiration, IdentityGrantNames = resources.IdentityResources.Select(x => x.DisplayName ?? x.Name).ToArray(), ApiGrantNames = resources.ApiScopes.Select(x => x.DisplayName ?? x.Name).ToArray() }; list.Add(item); } } return new GrantsViewModel { Grants = list }; } [HttpGet] [AllowAnonymous] public IActionResult Config() { return View(); } } } ================================================ FILE: Blog.IdentityServer/Controllers/Grants/GrantsViewModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using System; using System.Collections.Generic; namespace IdentityServer4.Quickstart.UI { public class GrantsViewModel { public IEnumerable Grants { get; set; } } public class GrantViewModel { public string ClientId { get; set; } public string ClientName { get; set; } public string ClientUrl { get; set; } public string ClientLogoUrl { get; set; } public string Description { get; set; } public DateTime Created { get; set; } public DateTime? Expires { get; set; } public IEnumerable IdentityGrantNames { get; set; } public IEnumerable ApiGrantNames { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Home/ErrorViewModel.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityServer4.Models; namespace IdentityServer4.Quickstart.UI { public class ErrorViewModel { public ErrorMessage Error { get; set; } } } ================================================ FILE: Blog.IdentityServer/Controllers/Home/HomeController.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityServer4.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System.Threading.Tasks; namespace IdentityServer4.Quickstart.UI { [SecurityHeaders] [AllowAnonymous] public class HomeController : Controller { private readonly IIdentityServerInteractionService _interaction; private readonly IWebHostEnvironment _environment; private readonly ILogger _logger; public HomeController(IIdentityServerInteractionService interaction, IWebHostEnvironment environment, ILogger logger) { _interaction = interaction; _environment = environment; _logger = logger; } public IActionResult Index() { return View(); //if (_environment.IsDevelopment()) //{ // // only show in development // return View(); //} //_logger.LogInformation("Homepage is disabled in production. Returning 404."); //return NotFound(); } /// /// Shows the error page /// public async Task Error(string errorId) { var vm = new ErrorViewModel(); // retrieve error details from identityserver var message = await _interaction.GetErrorContextAsync(errorId); if (message != null) { vm.Error = message; if (!_environment.IsDevelopment()) { // only show in development message.ErrorDescription = null; } } return View("Error", vm); } } } ================================================ FILE: Blog.IdentityServer/Controllers/Home/Is4ApiController.cs ================================================ using Blog.IdentityServer.Models; using Blog.IdentityServer.Models.ViewModel; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Blog.IdentityServer.Controllers { [Route("[controller]/[action]")] [ApiController] public class Is4ApiController : ControllerBase { private readonly UserManager _userManager; public Is4ApiController(UserManager userManager) { _userManager = userManager; } [HttpGet] public MessageModel GetAchieveUsers() { List apiDates = new List(); var users = _userManager.Users.Where(d => !d.tdIsDelete).OrderByDescending(d => d.Id).ToList(); var tadayRegisterUser = users.Where(d => d.birth >= DateTime.Now.Date).Count(); apiDates = (from n in users group n by new { n.birth.Date } into g select new ApiDate { date = g.Key?.Date.ToString("yyyy-MM-dd"), count = g.Count(), }).ToList(); apiDates = apiDates.OrderByDescending(d => d.date).Take(30).ToList(); if (apiDates.Count == 0) { apiDates.Add(new ApiDate() { date = "没数据,或未开启相应接口服务", count = 0 }); } return new MessageModel() { msg = "获取成功", success = true, response = new AccessApiDateView { columns = new string[] { "date", "count" }, rows = apiDates.OrderBy(d => d.date).ToList(), today = tadayRegisterUser, } }; } } } ================================================ FILE: Blog.IdentityServer/Controllers/SecurityHeadersAttribute.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; namespace IdentityServer4.Quickstart.UI { public class SecurityHeadersAttribute : ActionFilterAttribute { public override void OnResultExecuting(ResultExecutingContext context) { var result = context.Result; if (result is ViewResult) { // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Type-Options")) { context.HttpContext.Response.Headers.Add("X-Content-Type-Options", "nosniff"); } // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options if (!context.HttpContext.Response.Headers.ContainsKey("X-Frame-Options")) { context.HttpContext.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN"); } // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy var csp = "default-src 'self'; object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts; base-uri 'self';"; // also consider adding upgrade-insecure-requests once you have HTTPS in place for production //csp += "upgrade-insecure-requests;"; // also an example if you need client images to be displayed from twitter // csp += "img-src 'self' https://pbs.twimg.com;"; // once for standards compliant browsers if (!context.HttpContext.Response.Headers.ContainsKey("Content-Security-Policy")) { context.HttpContext.Response.Headers.Add("Content-Security-Policy", csp); } // and once again for IE if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Security-Policy")) { context.HttpContext.Response.Headers.Add("X-Content-Security-Policy", csp); } // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy var referrer_policy = "no-referrer"; if (!context.HttpContext.Response.Headers.ContainsKey("Referrer-Policy")) { context.HttpContext.Response.Headers.Add("Referrer-Policy", referrer_policy); } } } } } ================================================ FILE: Blog.IdentityServer/Controllers/TestUsers.cs ================================================ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. using IdentityModel; using IdentityServer4.Test; using System.Collections.Generic; using System.Security.Claims; namespace IdentityServer4.Quickstart.UI { public class TestUsers { public static List Users = new List { new TestUser{SubjectId = "818727", Username = "alice", Password = "alice", Claims = { new Claim(JwtClaimTypes.Name, "Alice Smith"), new Claim(JwtClaimTypes.GivenName, "Alice"), new Claim(JwtClaimTypes.FamilyName, "Smith"), new Claim(JwtClaimTypes.Email, "AliceSmith@email.com"), new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.WebSite, "http://alice.com"), new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json) } }, new TestUser{SubjectId = "88421113", Username = "bob", Password = "bob", Claims = { new Claim(JwtClaimTypes.Name, "Bob Smith"), new Claim(JwtClaimTypes.GivenName, "Bob"), new Claim(JwtClaimTypes.FamilyName, "Smith"), new Claim(JwtClaimTypes.Email, "BobSmith@email.com"), new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean), new Claim(JwtClaimTypes.WebSite, "http://bob.com"), new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json), new Claim("location", "somewhere") } } }; } } ================================================ FILE: Blog.IdentityServer/Data/ApplicationDbContext.cs ================================================ using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Blog.IdentityServer.Models; using Microsoft.AspNetCore.Identity; namespace Blog.IdentityServer.Data { //public class ApplicationDbContext : IdentityDbContext //{ // public ApplicationDbContext(DbContextOptions options) // : base(options) // { // } // protected override void OnModelCreating(ModelBuilder builder) // { // base.OnModelCreating(builder); // // Customize the ASP.NET Identity model and override the defaults if needed. // // For example, you can rename the ASP.NET Identity table names and more. // // Add your customizations after calling base.OnModelCreating(builder); // } //} public class ApplicationDbContext : IdentityDbContext, ApplicationUserRole, IdentityUserLogin, IdentityRoleClaim, IdentityUserToken> { public ApplicationDbContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); //builder.Entity(userRole => //{ // userRole.HasKey(ur => new { ur.UserId, ur.RoleId }); // userRole.HasOne(ur => ur.Role) // .WithMany(r => r.UserRoles) // .HasForeignKey(ur => ur.RoleId) // .IsRequired(); // userRole.HasOne(ur => ur.User) // .WithMany(r => r.UserRoles) // .HasForeignKey(ur => ur.UserId) // .IsRequired(); //}); //// 就是这里,我们可以修改下表名等其他任意操作 //builder.Entity() // .ToTable("Role"); } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/20200509165505_AppDbMigration.Designer.cs ================================================ // using System; using Blog.IdentityServer.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Blog.IdentityServer.Data.MigrationsMySql { [DbContext(typeof(ApplicationDbContext))] [Migration("20200509165505_AppDbMigration")] partial class AppDbMigration { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.3") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationRole", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("CreateBy") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("CreateId") .HasColumnType("int"); b.Property("CreateTime") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("IsDeleted") .HasColumnType("tinyint(1)"); b.Property("ModifyBy") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ModifyId") .HasColumnType("int"); b.Property("ModifyTime") .HasColumnType("datetime(6)"); b.Property("Name") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("NormalizedName") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("OrderSort") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasName("RoleNameIndex"); b.ToTable("AspNetRoles"); }); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationUser", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("AccessFailedCount") .HasColumnType("int"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Email") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("EmailConfirmed") .HasColumnType("tinyint(1)"); b.Property("LockoutEnabled") .HasColumnType("tinyint(1)"); b.Property("LockoutEnd") .HasColumnType("datetime(6)"); b.Property("LoginName") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("NormalizedEmail") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("NormalizedUserName") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("PasswordHash") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("PhoneNumber") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("PhoneNumberConfirmed") .HasColumnType("tinyint(1)"); b.Property("RealName") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("SecurityStamp") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("TwoFactorEnabled") .HasColumnType("tinyint(1)"); b.Property("UserName") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("addr") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("age") .HasColumnType("int"); b.Property("birth") .HasColumnType("datetime(6)"); b.Property("sex") .HasColumnType("int"); b.Property("tdIsDelete") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasName("UserNameIndex"); b.ToTable("AspNetUsers"); }); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationUserRole", b => { b.Property("UserId") .HasColumnType("int"); b.Property("RoleId") .HasColumnType("int"); b.Property("RoleId1") .HasColumnType("int"); b.Property("UserId1") .HasColumnType("int"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.HasIndex("RoleId1"); b.HasIndex("UserId1"); b.ToTable("AspNetUserRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClaimType") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ClaimValue") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("RoleId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClaimType") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ClaimValue") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("UserId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("ProviderKey") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("ProviderDisplayName") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("UserId") .HasColumnType("int"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("int"); b.Property("LoginProvider") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("Name") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("Value") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens"); }); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationUserRole", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Blog.IdentityServer.Models.ApplicationRole", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId1"); b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Blog.IdentityServer.Models.ApplicationUser", "User") .WithMany("UserRoles") .HasForeignKey("UserId1"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/20200509165505_AppDbMigration.cs ================================================ using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace Blog.IdentityServer.Data.MigrationsMySql { public partial class AppDbMigration : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AspNetRoles", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(maxLength: 256, nullable: true), NormalizedName = table.Column(maxLength: 256, nullable: true), ConcurrencyStamp = table.Column(nullable: true), IsDeleted = table.Column(nullable: false), Description = table.Column(nullable: true), OrderSort = table.Column(nullable: false), Enabled = table.Column(nullable: false), CreateId = table.Column(nullable: true), CreateBy = table.Column(nullable: true), CreateTime = table.Column(nullable: true), ModifyId = table.Column(nullable: true), ModifyBy = table.Column(nullable: true), ModifyTime = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetRoles", x => x.Id); }); migrationBuilder.CreateTable( name: "AspNetUsers", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), UserName = table.Column(maxLength: 256, nullable: true), NormalizedUserName = table.Column(maxLength: 256, nullable: true), Email = table.Column(maxLength: 256, nullable: true), NormalizedEmail = table.Column(maxLength: 256, nullable: true), EmailConfirmed = table.Column(nullable: false), PasswordHash = table.Column(nullable: true), SecurityStamp = table.Column(nullable: true), ConcurrencyStamp = table.Column(nullable: true), PhoneNumber = table.Column(nullable: true), PhoneNumberConfirmed = table.Column(nullable: false), TwoFactorEnabled = table.Column(nullable: false), LockoutEnd = table.Column(nullable: true), LockoutEnabled = table.Column(nullable: false), AccessFailedCount = table.Column(nullable: false), LoginName = table.Column(nullable: true), RealName = table.Column(nullable: true), sex = table.Column(nullable: false), age = table.Column(nullable: false), birth = table.Column(nullable: false), addr = table.Column(nullable: true), tdIsDelete = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_AspNetUsers", x => x.Id); }); migrationBuilder.CreateTable( name: "AspNetRoleClaims", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), RoleId = table.Column(nullable: false), ClaimType = table.Column(nullable: true), ClaimValue = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); table.ForeignKey( name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", column: x => x.RoleId, principalTable: "AspNetRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserClaims", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), UserId = table.Column(nullable: false), ClaimType = table.Column(nullable: true), ClaimValue = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); table.ForeignKey( name: "FK_AspNetUserClaims_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserLogins", columns: table => new { LoginProvider = table.Column(nullable: false), ProviderKey = table.Column(nullable: false), ProviderDisplayName = table.Column(nullable: true), UserId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); table.ForeignKey( name: "FK_AspNetUserLogins_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserRoles", columns: table => new { UserId = table.Column(nullable: false), RoleId = table.Column(nullable: false), UserId1 = table.Column(nullable: true), RoleId1 = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); table.ForeignKey( name: "FK_AspNetUserRoles_AspNetRoles_RoleId", column: x => x.RoleId, principalTable: "AspNetRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AspNetUserRoles_AspNetRoles_RoleId1", column: x => x.RoleId1, principalTable: "AspNetRoles", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_AspNetUserRoles_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AspNetUserRoles_AspNetUsers_UserId1", column: x => x.UserId1, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "AspNetUserTokens", columns: table => new { UserId = table.Column(nullable: false), LoginProvider = table.Column(nullable: false), Name = table.Column(nullable: false), Value = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); table.ForeignKey( name: "FK_AspNetUserTokens_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_AspNetRoleClaims_RoleId", table: "AspNetRoleClaims", column: "RoleId"); migrationBuilder.CreateIndex( name: "RoleNameIndex", table: "AspNetRoles", column: "NormalizedName", unique: true); migrationBuilder.CreateIndex( name: "IX_AspNetUserClaims_UserId", table: "AspNetUserClaims", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_AspNetUserLogins_UserId", table: "AspNetUserLogins", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_AspNetUserRoles_RoleId", table: "AspNetUserRoles", column: "RoleId"); migrationBuilder.CreateIndex( name: "IX_AspNetUserRoles_RoleId1", table: "AspNetUserRoles", column: "RoleId1"); migrationBuilder.CreateIndex( name: "IX_AspNetUserRoles_UserId1", table: "AspNetUserRoles", column: "UserId1"); migrationBuilder.CreateIndex( name: "EmailIndex", table: "AspNetUsers", column: "NormalizedEmail"); migrationBuilder.CreateIndex( name: "UserNameIndex", table: "AspNetUsers", column: "NormalizedUserName", unique: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AspNetRoleClaims"); migrationBuilder.DropTable( name: "AspNetUserClaims"); migrationBuilder.DropTable( name: "AspNetUserLogins"); migrationBuilder.DropTable( name: "AspNetUserRoles"); migrationBuilder.DropTable( name: "AspNetUserTokens"); migrationBuilder.DropTable( name: "AspNetRoles"); migrationBuilder.DropTable( name: "AspNetUsers"); } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/20210808045732_addQuestion.Designer.cs ================================================ // using System; using Blog.IdentityServer.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Blog.IdentityServer.Data.MigrationsMySql { [DbContext(typeof(ApplicationDbContext))] [Migration("20210808045732_addQuestion")] partial class addQuestion { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.5") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationRole", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("CreateBy") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("CreateId") .HasColumnType("int"); b.Property("CreateTime") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("IsDeleted") .HasColumnType("tinyint(1)"); b.Property("ModifyBy") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ModifyId") .HasColumnType("int"); b.Property("ModifyTime") .HasColumnType("datetime(6)"); b.Property("Name") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("NormalizedName") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("OrderSort") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasName("RoleNameIndex"); b.ToTable("AspNetRoles"); }); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationUser", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("AccessFailedCount") .HasColumnType("int"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Email") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("EmailConfirmed") .HasColumnType("tinyint(1)"); b.Property("FirstQuestion") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("LockoutEnabled") .HasColumnType("tinyint(1)"); b.Property("LockoutEnd") .HasColumnType("datetime(6)"); b.Property("LoginName") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("NormalizedEmail") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("NormalizedUserName") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("PasswordHash") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("PhoneNumber") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("PhoneNumberConfirmed") .HasColumnType("tinyint(1)"); b.Property("RealName") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("SecondQuestion") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("SecurityStamp") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("TwoFactorEnabled") .HasColumnType("tinyint(1)"); b.Property("UserName") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("addr") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("age") .HasColumnType("int"); b.Property("birth") .HasColumnType("datetime(6)"); b.Property("sex") .HasColumnType("int"); b.Property("tdIsDelete") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasName("UserNameIndex"); b.ToTable("AspNetUsers"); }); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationUserRole", b => { b.Property("UserId") .HasColumnType("int"); b.Property("RoleId") .HasColumnType("int"); b.Property("RoleId1") .HasColumnType("int"); b.Property("UserId1") .HasColumnType("int"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.HasIndex("RoleId1"); b.HasIndex("UserId1"); b.ToTable("AspNetUserRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClaimType") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ClaimValue") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("RoleId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClaimType") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ClaimValue") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("UserId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("ProviderKey") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("ProviderDisplayName") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("UserId") .HasColumnType("int"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("int"); b.Property("LoginProvider") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("Name") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("Value") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens"); }); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationUserRole", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Blog.IdentityServer.Models.ApplicationRole", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId1"); b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Blog.IdentityServer.Models.ApplicationUser", "User") .WithMany("UserRoles") .HasForeignKey("UserId1"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/20210808045732_addQuestion.cs ================================================ using Microsoft.EntityFrameworkCore.Migrations; namespace Blog.IdentityServer.Data.MigrationsMySql { public partial class addQuestion : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "FirstQuestion", table: "AspNetUsers", nullable: true); migrationBuilder.AddColumn( name: "SecondQuestion", table: "AspNetUsers", nullable: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "FirstQuestion", table: "AspNetUsers"); migrationBuilder.DropColumn( name: "SecondQuestion", table: "AspNetUsers"); } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/ApplicationDbContextModelSnapshot.cs ================================================ // using System; using Blog.IdentityServer.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Blog.IdentityServer.Data.MigrationsMySql { [DbContext(typeof(ApplicationDbContext))] partial class ApplicationDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.5") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationRole", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("CreateBy") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("CreateId") .HasColumnType("int"); b.Property("CreateTime") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("IsDeleted") .HasColumnType("tinyint(1)"); b.Property("ModifyBy") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ModifyId") .HasColumnType("int"); b.Property("ModifyTime") .HasColumnType("datetime(6)"); b.Property("Name") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("NormalizedName") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("OrderSort") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasName("RoleNameIndex"); b.ToTable("AspNetRoles"); }); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationUser", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("AccessFailedCount") .HasColumnType("int"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Email") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("EmailConfirmed") .HasColumnType("tinyint(1)"); b.Property("FirstQuestion") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("LockoutEnabled") .HasColumnType("tinyint(1)"); b.Property("LockoutEnd") .HasColumnType("datetime(6)"); b.Property("LoginName") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("NormalizedEmail") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("NormalizedUserName") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("PasswordHash") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("PhoneNumber") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("PhoneNumberConfirmed") .HasColumnType("tinyint(1)"); b.Property("RealName") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("SecondQuestion") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("SecurityStamp") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("TwoFactorEnabled") .HasColumnType("tinyint(1)"); b.Property("UserName") .HasColumnType("varchar(256) CHARACTER SET utf8mb4") .HasMaxLength(256); b.Property("addr") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("age") .HasColumnType("int"); b.Property("birth") .HasColumnType("datetime(6)"); b.Property("sex") .HasColumnType("int"); b.Property("tdIsDelete") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasName("UserNameIndex"); b.ToTable("AspNetUsers"); }); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationUserRole", b => { b.Property("UserId") .HasColumnType("int"); b.Property("RoleId") .HasColumnType("int"); b.Property("RoleId1") .HasColumnType("int"); b.Property("UserId1") .HasColumnType("int"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.HasIndex("RoleId1"); b.HasIndex("UserId1"); b.ToTable("AspNetUserRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClaimType") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ClaimValue") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("RoleId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClaimType") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ClaimValue") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("UserId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("ProviderKey") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("ProviderDisplayName") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("UserId") .HasColumnType("int"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("int"); b.Property("LoginProvider") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("Name") .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); b.Property("Value") .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens"); }); modelBuilder.Entity("Blog.IdentityServer.Models.ApplicationUserRole", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Blog.IdentityServer.Models.ApplicationRole", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId1"); b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Blog.IdentityServer.Models.ApplicationUser", "User") .WithMany("UserRoles") .HasForeignKey("UserId1"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.HasOne("Blog.IdentityServer.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/IdentityServer/ConfigurationDb/20200509165153_InitialIdentityServerConfigurationDbMigrationMysql.Designer.cs ================================================ // using System; using IdentityServer4.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Blog.IdentityServer.Data.MigrationsMySql.IdentityServer.ConfigurationDb { [DbContext(typeof(ConfigurationDbContext))] [Migration("20200509165153_InitialIdentityServerConfigurationDbMigrationMysql")] partial class InitialIdentityServerConfigurationDbMigrationMysql { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.3") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DisplayName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("LastAccessed") .HasColumnType("datetime(6)"); b.Property("Name") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("NonEditable") .HasColumnType("tinyint(1)"); b.Property("Updated") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("Name") .IsUnique(); b.ToTable("ApiResources"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DisplayName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Emphasize") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Required") .HasColumnType("tinyint(1)"); b.Property("ShowInDiscoveryDocument") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.HasIndex("Name") .IsUnique(); b.ToTable("ApiScopes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiScopeId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ApiScopeId"); b.ToTable("ApiScopeClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("Expiration") .HasColumnType("datetime(6)"); b.Property("Type") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(4000); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiSecrets"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("AbsoluteRefreshTokenLifetime") .HasColumnType("int"); b.Property("AccessTokenLifetime") .HasColumnType("int"); b.Property("AccessTokenType") .HasColumnType("int"); b.Property("AllowAccessTokensViaBrowser") .HasColumnType("tinyint(1)"); b.Property("AllowOfflineAccess") .HasColumnType("tinyint(1)"); b.Property("AllowPlainTextPkce") .HasColumnType("tinyint(1)"); b.Property("AllowRememberConsent") .HasColumnType("tinyint(1)"); b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("tinyint(1)"); b.Property("AlwaysSendClientClaims") .HasColumnType("tinyint(1)"); b.Property("AuthorizationCodeLifetime") .HasColumnType("int"); b.Property("BackChannelLogoutSessionRequired") .HasColumnType("tinyint(1)"); b.Property("BackChannelLogoutUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("ClientClaimsPrefix") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientId") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("ConsentLifetime") .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DeviceCodeLifetime") .HasColumnType("int"); b.Property("EnableLocalLogin") .HasColumnType("tinyint(1)"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("FrontChannelLogoutSessionRequired") .HasColumnType("tinyint(1)"); b.Property("FrontChannelLogoutUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("IdentityTokenLifetime") .HasColumnType("int"); b.Property("IncludeJwtId") .HasColumnType("tinyint(1)"); b.Property("LastAccessed") .HasColumnType("datetime(6)"); b.Property("LogoUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("NonEditable") .HasColumnType("tinyint(1)"); b.Property("PairWiseSubjectSalt") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ProtocolType") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("RefreshTokenExpiration") .HasColumnType("int"); b.Property("RefreshTokenUsage") .HasColumnType("int"); b.Property("RequireClientSecret") .HasColumnType("tinyint(1)"); b.Property("RequireConsent") .HasColumnType("tinyint(1)"); b.Property("RequirePkce") .HasColumnType("tinyint(1)"); b.Property("SlidingRefreshTokenLifetime") .HasColumnType("int"); b.Property("UpdateAccessTokenClaimsOnRefresh") .HasColumnType("tinyint(1)"); b.Property("Updated") .HasColumnType("datetime(6)"); b.Property("UserCodeType") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("UserSsoLifetime") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ClientId") .IsUnique(); b.ToTable("Clients"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Origin") .IsRequired() .HasColumnType("varchar(150) CHARACTER SET utf8mb4") .HasMaxLength(150); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientCorsOrigins"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("GrantType") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientGrantTypes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Provider") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientIdPRestrictions"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("PostLogoutRedirectUri") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientPostLogoutRedirectUris"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("RedirectUri") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientRedirectUris"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Scope") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientScopes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("Expiration") .HasColumnType("datetime(6)"); b.Property("Type") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(4000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientSecrets"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("IdentityResourceId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("IdentityResourceId"); b.ToTable("IdentityClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DisplayName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Emphasize") .HasColumnType("tinyint(1)"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("NonEditable") .HasColumnType("tinyint(1)"); b.Property("Required") .HasColumnType("tinyint(1)"); b.Property("ShowInDiscoveryDocument") .HasColumnType("tinyint(1)"); b.Property("Updated") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("Name") .IsUnique(); b.ToTable("IdentityResources"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("IdentityResourceId") .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("IdentityResourceId"); b.ToTable("IdentityProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("UserClaims") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Properties") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Scopes") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "ApiScope") .WithMany("UserClaims") .HasForeignKey("ApiScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Secrets") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("Claims") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("AllowedCorsOrigins") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("AllowedGrantTypes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("IdentityProviderRestrictions") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("PostLogoutRedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("Properties") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("RedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("AllowedScopes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("ClientSecrets") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("UserClaims") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("Properties") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/IdentityServer/ConfigurationDb/20200509165153_InitialIdentityServerConfigurationDbMigrationMysql.cs ================================================ using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace Blog.IdentityServer.Data.MigrationsMySql.IdentityServer.ConfigurationDb { public partial class InitialIdentityServerConfigurationDbMigrationMysql : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ApiResources", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Enabled = table.Column(nullable: false), Name = table.Column(maxLength: 200, nullable: false), DisplayName = table.Column(maxLength: 200, nullable: true), Description = table.Column(maxLength: 1000, nullable: true), Created = table.Column(nullable: false), Updated = table.Column(nullable: true), LastAccessed = table.Column(nullable: true), NonEditable = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiResources", x => x.Id); }); migrationBuilder.CreateTable( name: "Clients", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Enabled = table.Column(nullable: false), ClientId = table.Column(maxLength: 200, nullable: false), ProtocolType = table.Column(maxLength: 200, nullable: false), RequireClientSecret = table.Column(nullable: false), ClientName = table.Column(maxLength: 200, nullable: true), Description = table.Column(maxLength: 1000, nullable: true), ClientUri = table.Column(maxLength: 2000, nullable: true), LogoUri = table.Column(maxLength: 2000, nullable: true), RequireConsent = table.Column(nullable: false), AllowRememberConsent = table.Column(nullable: false), AlwaysIncludeUserClaimsInIdToken = table.Column(nullable: false), RequirePkce = table.Column(nullable: false), AllowPlainTextPkce = table.Column(nullable: false), AllowAccessTokensViaBrowser = table.Column(nullable: false), FrontChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), FrontChannelLogoutSessionRequired = table.Column(nullable: false), BackChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), BackChannelLogoutSessionRequired = table.Column(nullable: false), AllowOfflineAccess = table.Column(nullable: false), IdentityTokenLifetime = table.Column(nullable: false), AccessTokenLifetime = table.Column(nullable: false), AuthorizationCodeLifetime = table.Column(nullable: false), ConsentLifetime = table.Column(nullable: true), AbsoluteRefreshTokenLifetime = table.Column(nullable: false), SlidingRefreshTokenLifetime = table.Column(nullable: false), RefreshTokenUsage = table.Column(nullable: false), UpdateAccessTokenClaimsOnRefresh = table.Column(nullable: false), RefreshTokenExpiration = table.Column(nullable: false), AccessTokenType = table.Column(nullable: false), EnableLocalLogin = table.Column(nullable: false), IncludeJwtId = table.Column(nullable: false), AlwaysSendClientClaims = table.Column(nullable: false), ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), Created = table.Column(nullable: false), Updated = table.Column(nullable: true), LastAccessed = table.Column(nullable: true), UserSsoLifetime = table.Column(nullable: true), UserCodeType = table.Column(maxLength: 100, nullable: true), DeviceCodeLifetime = table.Column(nullable: false), NonEditable = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Clients", x => x.Id); }); migrationBuilder.CreateTable( name: "IdentityResources", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Enabled = table.Column(nullable: false), Name = table.Column(maxLength: 200, nullable: false), DisplayName = table.Column(maxLength: 200, nullable: true), Description = table.Column(maxLength: 1000, nullable: true), Required = table.Column(nullable: false), Emphasize = table.Column(nullable: false), ShowInDiscoveryDocument = table.Column(nullable: false), Created = table.Column(nullable: false), Updated = table.Column(nullable: true), NonEditable = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_IdentityResources", x => x.Id); }); migrationBuilder.CreateTable( name: "ApiClaims", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Type = table.Column(maxLength: 200, nullable: false), ApiResourceId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiClaims", x => x.Id); table.ForeignKey( name: "FK_ApiClaims_ApiResources_ApiResourceId", column: x => x.ApiResourceId, principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ApiProperties", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Key = table.Column(maxLength: 250, nullable: false), Value = table.Column(maxLength: 2000, nullable: false), ApiResourceId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiProperties", x => x.Id); table.ForeignKey( name: "FK_ApiProperties_ApiResources_ApiResourceId", column: x => x.ApiResourceId, principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ApiScopes", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(maxLength: 200, nullable: false), DisplayName = table.Column(maxLength: 200, nullable: true), Description = table.Column(maxLength: 1000, nullable: true), Required = table.Column(nullable: false), Emphasize = table.Column(nullable: false), ShowInDiscoveryDocument = table.Column(nullable: false), ApiResourceId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiScopes", x => x.Id); table.ForeignKey( name: "FK_ApiScopes_ApiResources_ApiResourceId", column: x => x.ApiResourceId, principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ApiSecrets", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Description = table.Column(maxLength: 1000, nullable: true), Value = table.Column(maxLength: 4000, nullable: false), Expiration = table.Column(nullable: true), Type = table.Column(maxLength: 250, nullable: false), Created = table.Column(nullable: false), ApiResourceId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiSecrets", x => x.Id); table.ForeignKey( name: "FK_ApiSecrets_ApiResources_ApiResourceId", column: x => x.ApiResourceId, principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ClientClaims", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Type = table.Column(maxLength: 250, nullable: false), Value = table.Column(maxLength: 250, nullable: false), ClientId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ClientClaims", x => x.Id); table.ForeignKey( name: "FK_ClientClaims_Clients_ClientId", column: x => x.ClientId, principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ClientCorsOrigins", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Origin = table.Column(maxLength: 150, nullable: false), ClientId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ClientCorsOrigins", x => x.Id); table.ForeignKey( name: "FK_ClientCorsOrigins_Clients_ClientId", column: x => x.ClientId, principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ClientGrantTypes", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), GrantType = table.Column(maxLength: 250, nullable: false), ClientId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ClientGrantTypes", x => x.Id); table.ForeignKey( name: "FK_ClientGrantTypes_Clients_ClientId", column: x => x.ClientId, principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ClientIdPRestrictions", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Provider = table.Column(maxLength: 200, nullable: false), ClientId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ClientIdPRestrictions", x => x.Id); table.ForeignKey( name: "FK_ClientIdPRestrictions_Clients_ClientId", column: x => x.ClientId, principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ClientPostLogoutRedirectUris", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), PostLogoutRedirectUri = table.Column(maxLength: 2000, nullable: false), ClientId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ClientPostLogoutRedirectUris", x => x.Id); table.ForeignKey( name: "FK_ClientPostLogoutRedirectUris_Clients_ClientId", column: x => x.ClientId, principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ClientProperties", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Key = table.Column(maxLength: 250, nullable: false), Value = table.Column(maxLength: 2000, nullable: false), ClientId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ClientProperties", x => x.Id); table.ForeignKey( name: "FK_ClientProperties_Clients_ClientId", column: x => x.ClientId, principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ClientRedirectUris", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), RedirectUri = table.Column(maxLength: 2000, nullable: false), ClientId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ClientRedirectUris", x => x.Id); table.ForeignKey( name: "FK_ClientRedirectUris_Clients_ClientId", column: x => x.ClientId, principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ClientScopes", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Scope = table.Column(maxLength: 200, nullable: false), ClientId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ClientScopes", x => x.Id); table.ForeignKey( name: "FK_ClientScopes_Clients_ClientId", column: x => x.ClientId, principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ClientSecrets", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Description = table.Column(maxLength: 2000, nullable: true), Value = table.Column(maxLength: 4000, nullable: false), Expiration = table.Column(nullable: true), Type = table.Column(maxLength: 250, nullable: false), Created = table.Column(nullable: false), ClientId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ClientSecrets", x => x.Id); table.ForeignKey( name: "FK_ClientSecrets_Clients_ClientId", column: x => x.ClientId, principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "IdentityClaims", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Type = table.Column(maxLength: 200, nullable: false), IdentityResourceId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_IdentityClaims", x => x.Id); table.ForeignKey( name: "FK_IdentityClaims_IdentityResources_IdentityResourceId", column: x => x.IdentityResourceId, principalTable: "IdentityResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "IdentityProperties", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Key = table.Column(maxLength: 250, nullable: false), Value = table.Column(maxLength: 2000, nullable: false), IdentityResourceId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_IdentityProperties", x => x.Id); table.ForeignKey( name: "FK_IdentityProperties_IdentityResources_IdentityResourceId", column: x => x.IdentityResourceId, principalTable: "IdentityResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ApiScopeClaims", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Type = table.Column(maxLength: 200, nullable: false), ApiScopeId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiScopeClaims", x => x.Id); table.ForeignKey( name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId", column: x => x.ApiScopeId, principalTable: "ApiScopes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_ApiClaims_ApiResourceId", table: "ApiClaims", column: "ApiResourceId"); migrationBuilder.CreateIndex( name: "IX_ApiProperties_ApiResourceId", table: "ApiProperties", column: "ApiResourceId"); migrationBuilder.CreateIndex( name: "IX_ApiResources_Name", table: "ApiResources", column: "Name", unique: true); migrationBuilder.CreateIndex( name: "IX_ApiScopeClaims_ApiScopeId", table: "ApiScopeClaims", column: "ApiScopeId"); migrationBuilder.CreateIndex( name: "IX_ApiScopes_ApiResourceId", table: "ApiScopes", column: "ApiResourceId"); migrationBuilder.CreateIndex( name: "IX_ApiScopes_Name", table: "ApiScopes", column: "Name", unique: true); migrationBuilder.CreateIndex( name: "IX_ApiSecrets_ApiResourceId", table: "ApiSecrets", column: "ApiResourceId"); migrationBuilder.CreateIndex( name: "IX_ClientClaims_ClientId", table: "ClientClaims", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_ClientCorsOrigins_ClientId", table: "ClientCorsOrigins", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_ClientGrantTypes_ClientId", table: "ClientGrantTypes", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_ClientIdPRestrictions_ClientId", table: "ClientIdPRestrictions", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_ClientPostLogoutRedirectUris_ClientId", table: "ClientPostLogoutRedirectUris", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_ClientProperties_ClientId", table: "ClientProperties", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_ClientRedirectUris_ClientId", table: "ClientRedirectUris", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_Clients_ClientId", table: "Clients", column: "ClientId", unique: true); migrationBuilder.CreateIndex( name: "IX_ClientScopes_ClientId", table: "ClientScopes", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_ClientSecrets_ClientId", table: "ClientSecrets", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_IdentityClaims_IdentityResourceId", table: "IdentityClaims", column: "IdentityResourceId"); migrationBuilder.CreateIndex( name: "IX_IdentityProperties_IdentityResourceId", table: "IdentityProperties", column: "IdentityResourceId"); migrationBuilder.CreateIndex( name: "IX_IdentityResources_Name", table: "IdentityResources", column: "Name", unique: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ApiClaims"); migrationBuilder.DropTable( name: "ApiProperties"); migrationBuilder.DropTable( name: "ApiScopeClaims"); migrationBuilder.DropTable( name: "ApiSecrets"); migrationBuilder.DropTable( name: "ClientClaims"); migrationBuilder.DropTable( name: "ClientCorsOrigins"); migrationBuilder.DropTable( name: "ClientGrantTypes"); migrationBuilder.DropTable( name: "ClientIdPRestrictions"); migrationBuilder.DropTable( name: "ClientPostLogoutRedirectUris"); migrationBuilder.DropTable( name: "ClientProperties"); migrationBuilder.DropTable( name: "ClientRedirectUris"); migrationBuilder.DropTable( name: "ClientScopes"); migrationBuilder.DropTable( name: "ClientSecrets"); migrationBuilder.DropTable( name: "IdentityClaims"); migrationBuilder.DropTable( name: "IdentityProperties"); migrationBuilder.DropTable( name: "ApiScopes"); migrationBuilder.DropTable( name: "Clients"); migrationBuilder.DropTable( name: "IdentityResources"); migrationBuilder.DropTable( name: "ApiResources"); } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/IdentityServer/ConfigurationDb/20200715033226_InitConfigurationDbV4.Designer.cs ================================================ // using System; using IdentityServer4.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Blog.IdentityServer.Data.MigrationsMySql.IdentityServer.ConfigurationDb { [DbContext(typeof(ConfigurationDbContext))] [Migration("20200715033226_InitConfigurationDbV4")] partial class InitConfigurationDbV4 { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.5") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("AllowedAccessTokenSigningAlgorithms") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DisplayName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("LastAccessed") .HasColumnType("datetime(6)"); b.Property("Name") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("NonEditable") .HasColumnType("tinyint(1)"); b.Property("ShowInDiscoveryDocument") .HasColumnType("tinyint(1)"); b.Property("Updated") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("Name") .IsUnique(); b.ToTable("ApiResources"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiResourceClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiResourceProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Scope") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiResourceScopes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("Expiration") .HasColumnType("datetime(6)"); b.Property("Type") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(4000); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiResourceSecrets"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DisplayName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Emphasize") .HasColumnType("tinyint(1)"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Required") .HasColumnType("tinyint(1)"); b.Property("ShowInDiscoveryDocument") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("Name") .IsUnique(); b.ToTable("ApiScopes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ScopeId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ScopeId"); b.ToTable("ApiScopeClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("ScopeId") .HasColumnType("int"); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ScopeId"); b.ToTable("ApiScopeProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("AbsoluteRefreshTokenLifetime") .HasColumnType("int"); b.Property("AccessTokenLifetime") .HasColumnType("int"); b.Property("AccessTokenType") .HasColumnType("int"); b.Property("AllowAccessTokensViaBrowser") .HasColumnType("tinyint(1)"); b.Property("AllowOfflineAccess") .HasColumnType("tinyint(1)"); b.Property("AllowPlainTextPkce") .HasColumnType("tinyint(1)"); b.Property("AllowRememberConsent") .HasColumnType("tinyint(1)"); b.Property("AllowedIdentityTokenSigningAlgorithms") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("tinyint(1)"); b.Property("AlwaysSendClientClaims") .HasColumnType("tinyint(1)"); b.Property("AuthorizationCodeLifetime") .HasColumnType("int"); b.Property("BackChannelLogoutSessionRequired") .HasColumnType("tinyint(1)"); b.Property("BackChannelLogoutUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("ClientClaimsPrefix") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientId") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("ConsentLifetime") .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DeviceCodeLifetime") .HasColumnType("int"); b.Property("EnableLocalLogin") .HasColumnType("tinyint(1)"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("FrontChannelLogoutSessionRequired") .HasColumnType("tinyint(1)"); b.Property("FrontChannelLogoutUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("IdentityTokenLifetime") .HasColumnType("int"); b.Property("IncludeJwtId") .HasColumnType("tinyint(1)"); b.Property("LastAccessed") .HasColumnType("datetime(6)"); b.Property("LogoUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("NonEditable") .HasColumnType("tinyint(1)"); b.Property("PairWiseSubjectSalt") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ProtocolType") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("RefreshTokenExpiration") .HasColumnType("int"); b.Property("RefreshTokenUsage") .HasColumnType("int"); b.Property("RequireClientSecret") .HasColumnType("tinyint(1)"); b.Property("RequireConsent") .HasColumnType("tinyint(1)"); b.Property("RequirePkce") .HasColumnType("tinyint(1)"); b.Property("RequireRequestObject") .HasColumnType("tinyint(1)"); b.Property("SlidingRefreshTokenLifetime") .HasColumnType("int"); b.Property("UpdateAccessTokenClaimsOnRefresh") .HasColumnType("tinyint(1)"); b.Property("Updated") .HasColumnType("datetime(6)"); b.Property("UserCodeType") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("UserSsoLifetime") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ClientId") .IsUnique(); b.ToTable("Clients"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Origin") .IsRequired() .HasColumnType("varchar(150) CHARACTER SET utf8mb4") .HasMaxLength(150); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientCorsOrigins"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("GrantType") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientGrantTypes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Provider") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientIdPRestrictions"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("PostLogoutRedirectUri") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientPostLogoutRedirectUris"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("RedirectUri") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientRedirectUris"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Scope") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientScopes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("Expiration") .HasColumnType("datetime(6)"); b.Property("Type") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(4000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientSecrets"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DisplayName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Emphasize") .HasColumnType("tinyint(1)"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("NonEditable") .HasColumnType("tinyint(1)"); b.Property("Required") .HasColumnType("tinyint(1)"); b.Property("ShowInDiscoveryDocument") .HasColumnType("tinyint(1)"); b.Property("Updated") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("Name") .IsUnique(); b.ToTable("IdentityResources"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("IdentityResourceId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("IdentityResourceId"); b.ToTable("IdentityResourceClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("IdentityResourceId") .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("IdentityResourceId"); b.ToTable("IdentityResourceProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("UserClaims") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Properties") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Scopes") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Secrets") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") .WithMany("UserClaims") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") .WithMany("Properties") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("Claims") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("AllowedCorsOrigins") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("AllowedGrantTypes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("IdentityProviderRestrictions") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("PostLogoutRedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("Properties") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("RedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("AllowedScopes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("ClientSecrets") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("UserClaims") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("Properties") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/IdentityServer/ConfigurationDb/20200715033226_InitConfigurationDbV4.cs ================================================ using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace Blog.IdentityServer.Data.MigrationsMySql.IdentityServer.ConfigurationDb { public partial class InitConfigurationDbV4 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_ApiClaims_ApiResources_ApiResourceId", table: "ApiClaims"); migrationBuilder.DropForeignKey( name: "FK_ApiProperties_ApiResources_ApiResourceId", table: "ApiProperties"); migrationBuilder.DropForeignKey( name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId", table: "ApiScopeClaims"); migrationBuilder.DropForeignKey( name: "FK_ApiScopes_ApiResources_ApiResourceId", table: "ApiScopes"); migrationBuilder.DropForeignKey( name: "FK_IdentityProperties_IdentityResources_IdentityResourceId", table: "IdentityProperties"); migrationBuilder.DropTable( name: "ApiSecrets"); migrationBuilder.DropTable( name: "IdentityClaims"); migrationBuilder.DropIndex( name: "IX_ApiScopes_ApiResourceId", table: "ApiScopes"); migrationBuilder.DropIndex( name: "IX_ApiScopeClaims_ApiScopeId", table: "ApiScopeClaims"); migrationBuilder.DropPrimaryKey( name: "PK_IdentityProperties", table: "IdentityProperties"); migrationBuilder.DropPrimaryKey( name: "PK_ApiProperties", table: "ApiProperties"); migrationBuilder.DropPrimaryKey( name: "PK_ApiClaims", table: "ApiClaims"); migrationBuilder.DropColumn( name: "ApiResourceId", table: "ApiScopes"); migrationBuilder.DropColumn( name: "ApiScopeId", table: "ApiScopeClaims"); migrationBuilder.RenameTable( name: "IdentityProperties", newName: "IdentityResourceProperties"); migrationBuilder.RenameTable( name: "ApiProperties", newName: "ApiResourceProperties"); migrationBuilder.RenameTable( name: "ApiClaims", newName: "ApiResourceClaims"); migrationBuilder.RenameIndex( name: "IX_IdentityProperties_IdentityResourceId", table: "IdentityResourceProperties", newName: "IX_IdentityResourceProperties_IdentityResourceId"); migrationBuilder.RenameIndex( name: "IX_ApiProperties_ApiResourceId", table: "ApiResourceProperties", newName: "IX_ApiResourceProperties_ApiResourceId"); migrationBuilder.RenameIndex( name: "IX_ApiClaims_ApiResourceId", table: "ApiResourceClaims", newName: "IX_ApiResourceClaims_ApiResourceId"); migrationBuilder.AddColumn( name: "AllowedIdentityTokenSigningAlgorithms", table: "Clients", maxLength: 100, nullable: true); migrationBuilder.AddColumn( name: "RequireRequestObject", table: "Clients", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "Enabled", table: "ApiScopes", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "ScopeId", table: "ApiScopeClaims", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "AllowedAccessTokenSigningAlgorithms", table: "ApiResources", maxLength: 100, nullable: true); migrationBuilder.AddColumn( name: "ShowInDiscoveryDocument", table: "ApiResources", nullable: false, defaultValue: false); migrationBuilder.AddPrimaryKey( name: "PK_IdentityResourceProperties", table: "IdentityResourceProperties", column: "Id"); migrationBuilder.AddPrimaryKey( name: "PK_ApiResourceProperties", table: "ApiResourceProperties", column: "Id"); migrationBuilder.AddPrimaryKey( name: "PK_ApiResourceClaims", table: "ApiResourceClaims", column: "Id"); migrationBuilder.CreateTable( name: "ApiResourceScopes", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Scope = table.Column(maxLength: 200, nullable: false), ApiResourceId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiResourceScopes", x => x.Id); table.ForeignKey( name: "FK_ApiResourceScopes_ApiResources_ApiResourceId", column: x => x.ApiResourceId, principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ApiResourceSecrets", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Description = table.Column(maxLength: 1000, nullable: true), Value = table.Column(maxLength: 4000, nullable: false), Expiration = table.Column(nullable: true), Type = table.Column(maxLength: 250, nullable: false), Created = table.Column(nullable: false), ApiResourceId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiResourceSecrets", x => x.Id); table.ForeignKey( name: "FK_ApiResourceSecrets_ApiResources_ApiResourceId", column: x => x.ApiResourceId, principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ApiScopeProperties", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Key = table.Column(maxLength: 250, nullable: false), Value = table.Column(maxLength: 2000, nullable: false), ScopeId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiScopeProperties", x => x.Id); table.ForeignKey( name: "FK_ApiScopeProperties_ApiScopes_ScopeId", column: x => x.ScopeId, principalTable: "ApiScopes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "IdentityResourceClaims", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Type = table.Column(maxLength: 200, nullable: false), IdentityResourceId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_IdentityResourceClaims", x => x.Id); table.ForeignKey( name: "FK_IdentityResourceClaims_IdentityResources_IdentityResourceId", column: x => x.IdentityResourceId, principalTable: "IdentityResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_ApiScopeClaims_ScopeId", table: "ApiScopeClaims", column: "ScopeId"); migrationBuilder.CreateIndex( name: "IX_ApiResourceScopes_ApiResourceId", table: "ApiResourceScopes", column: "ApiResourceId"); migrationBuilder.CreateIndex( name: "IX_ApiResourceSecrets_ApiResourceId", table: "ApiResourceSecrets", column: "ApiResourceId"); migrationBuilder.CreateIndex( name: "IX_ApiScopeProperties_ScopeId", table: "ApiScopeProperties", column: "ScopeId"); migrationBuilder.CreateIndex( name: "IX_IdentityResourceClaims_IdentityResourceId", table: "IdentityResourceClaims", column: "IdentityResourceId"); migrationBuilder.AddForeignKey( name: "FK_ApiResourceClaims_ApiResources_ApiResourceId", table: "ApiResourceClaims", column: "ApiResourceId", principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_ApiResourceProperties_ApiResources_ApiResourceId", table: "ApiResourceProperties", column: "ApiResourceId", principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_ApiScopeClaims_ApiScopes_ScopeId", table: "ApiScopeClaims", column: "ScopeId", principalTable: "ApiScopes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_IdentityResourceProperties_IdentityResources_IdentityResourc~", table: "IdentityResourceProperties", column: "IdentityResourceId", principalTable: "IdentityResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_ApiResourceClaims_ApiResources_ApiResourceId", table: "ApiResourceClaims"); migrationBuilder.DropForeignKey( name: "FK_ApiResourceProperties_ApiResources_ApiResourceId", table: "ApiResourceProperties"); migrationBuilder.DropForeignKey( name: "FK_ApiScopeClaims_ApiScopes_ScopeId", table: "ApiScopeClaims"); migrationBuilder.DropForeignKey( name: "FK_IdentityResourceProperties_IdentityResources_IdentityResourc~", table: "IdentityResourceProperties"); migrationBuilder.DropTable( name: "ApiResourceScopes"); migrationBuilder.DropTable( name: "ApiResourceSecrets"); migrationBuilder.DropTable( name: "ApiScopeProperties"); migrationBuilder.DropTable( name: "IdentityResourceClaims"); migrationBuilder.DropIndex( name: "IX_ApiScopeClaims_ScopeId", table: "ApiScopeClaims"); migrationBuilder.DropPrimaryKey( name: "PK_IdentityResourceProperties", table: "IdentityResourceProperties"); migrationBuilder.DropPrimaryKey( name: "PK_ApiResourceProperties", table: "ApiResourceProperties"); migrationBuilder.DropPrimaryKey( name: "PK_ApiResourceClaims", table: "ApiResourceClaims"); migrationBuilder.DropColumn( name: "AllowedIdentityTokenSigningAlgorithms", table: "Clients"); migrationBuilder.DropColumn( name: "RequireRequestObject", table: "Clients"); migrationBuilder.DropColumn( name: "Enabled", table: "ApiScopes"); migrationBuilder.DropColumn( name: "ScopeId", table: "ApiScopeClaims"); migrationBuilder.DropColumn( name: "AllowedAccessTokenSigningAlgorithms", table: "ApiResources"); migrationBuilder.DropColumn( name: "ShowInDiscoveryDocument", table: "ApiResources"); migrationBuilder.RenameTable( name: "IdentityResourceProperties", newName: "IdentityProperties"); migrationBuilder.RenameTable( name: "ApiResourceProperties", newName: "ApiProperties"); migrationBuilder.RenameTable( name: "ApiResourceClaims", newName: "ApiClaims"); migrationBuilder.RenameIndex( name: "IX_IdentityResourceProperties_IdentityResourceId", table: "IdentityProperties", newName: "IX_IdentityProperties_IdentityResourceId"); migrationBuilder.RenameIndex( name: "IX_ApiResourceProperties_ApiResourceId", table: "ApiProperties", newName: "IX_ApiProperties_ApiResourceId"); migrationBuilder.RenameIndex( name: "IX_ApiResourceClaims_ApiResourceId", table: "ApiClaims", newName: "IX_ApiClaims_ApiResourceId"); migrationBuilder.AddColumn( name: "ApiResourceId", table: "ApiScopes", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "ApiScopeId", table: "ApiScopeClaims", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddPrimaryKey( name: "PK_IdentityProperties", table: "IdentityProperties", column: "Id"); migrationBuilder.AddPrimaryKey( name: "PK_ApiProperties", table: "ApiProperties", column: "Id"); migrationBuilder.AddPrimaryKey( name: "PK_ApiClaims", table: "ApiClaims", column: "Id"); migrationBuilder.CreateTable( name: "ApiSecrets", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), ApiResourceId = table.Column(type: "int", nullable: false), Created = table.Column(type: "datetime(6)", nullable: false), Description = table.Column(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: true), Expiration = table.Column(type: "datetime(6)", nullable: true), Type = table.Column(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false), Value = table.Column(type: "longtext CHARACTER SET utf8mb4", maxLength: 4000, nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiSecrets", x => x.Id); table.ForeignKey( name: "FK_ApiSecrets_ApiResources_ApiResourceId", column: x => x.ApiResourceId, principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "IdentityClaims", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), IdentityResourceId = table.Column(type: "int", nullable: false), Type = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false) }, constraints: table => { table.PrimaryKey("PK_IdentityClaims", x => x.Id); table.ForeignKey( name: "FK_IdentityClaims_IdentityResources_IdentityResourceId", column: x => x.IdentityResourceId, principalTable: "IdentityResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_ApiScopes_ApiResourceId", table: "ApiScopes", column: "ApiResourceId"); migrationBuilder.CreateIndex( name: "IX_ApiScopeClaims_ApiScopeId", table: "ApiScopeClaims", column: "ApiScopeId"); migrationBuilder.CreateIndex( name: "IX_ApiSecrets_ApiResourceId", table: "ApiSecrets", column: "ApiResourceId"); migrationBuilder.CreateIndex( name: "IX_IdentityClaims_IdentityResourceId", table: "IdentityClaims", column: "IdentityResourceId"); migrationBuilder.AddForeignKey( name: "FK_ApiClaims_ApiResources_ApiResourceId", table: "ApiClaims", column: "ApiResourceId", principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_ApiProperties_ApiResources_ApiResourceId", table: "ApiProperties", column: "ApiResourceId", principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId", table: "ApiScopeClaims", column: "ApiScopeId", principalTable: "ApiScopes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_ApiScopes_ApiResources_ApiResourceId", table: "ApiScopes", column: "ApiResourceId", principalTable: "ApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_IdentityProperties_IdentityResources_IdentityResourceId", table: "IdentityProperties", column: "IdentityResourceId", principalTable: "IdentityResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/IdentityServer/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs ================================================ // using System; using IdentityServer4.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Blog.IdentityServer.Data.MigrationsMySql.IdentityServer.ConfigurationDb { [DbContext(typeof(ConfigurationDbContext))] partial class ConfigurationDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.5") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("AllowedAccessTokenSigningAlgorithms") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DisplayName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("LastAccessed") .HasColumnType("datetime(6)"); b.Property("Name") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("NonEditable") .HasColumnType("tinyint(1)"); b.Property("ShowInDiscoveryDocument") .HasColumnType("tinyint(1)"); b.Property("Updated") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("Name") .IsUnique(); b.ToTable("ApiResources"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiResourceClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiResourceProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Scope") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiResourceScopes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ApiResourceId") .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("Expiration") .HasColumnType("datetime(6)"); b.Property("Type") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(4000); b.HasKey("Id"); b.HasIndex("ApiResourceId"); b.ToTable("ApiResourceSecrets"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DisplayName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Emphasize") .HasColumnType("tinyint(1)"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Required") .HasColumnType("tinyint(1)"); b.Property("ShowInDiscoveryDocument") .HasColumnType("tinyint(1)"); b.HasKey("Id"); b.HasIndex("Name") .IsUnique(); b.ToTable("ApiScopes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ScopeId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ScopeId"); b.ToTable("ApiScopeClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("ScopeId") .HasColumnType("int"); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ScopeId"); b.ToTable("ApiScopeProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("AbsoluteRefreshTokenLifetime") .HasColumnType("int"); b.Property("AccessTokenLifetime") .HasColumnType("int"); b.Property("AccessTokenType") .HasColumnType("int"); b.Property("AllowAccessTokensViaBrowser") .HasColumnType("tinyint(1)"); b.Property("AllowOfflineAccess") .HasColumnType("tinyint(1)"); b.Property("AllowPlainTextPkce") .HasColumnType("tinyint(1)"); b.Property("AllowRememberConsent") .HasColumnType("tinyint(1)"); b.Property("AllowedIdentityTokenSigningAlgorithms") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("tinyint(1)"); b.Property("AlwaysSendClientClaims") .HasColumnType("tinyint(1)"); b.Property("AuthorizationCodeLifetime") .HasColumnType("int"); b.Property("BackChannelLogoutSessionRequired") .HasColumnType("tinyint(1)"); b.Property("BackChannelLogoutUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("ClientClaimsPrefix") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientId") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("ConsentLifetime") .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DeviceCodeLifetime") .HasColumnType("int"); b.Property("EnableLocalLogin") .HasColumnType("tinyint(1)"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("FrontChannelLogoutSessionRequired") .HasColumnType("tinyint(1)"); b.Property("FrontChannelLogoutUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("IdentityTokenLifetime") .HasColumnType("int"); b.Property("IncludeJwtId") .HasColumnType("tinyint(1)"); b.Property("LastAccessed") .HasColumnType("datetime(6)"); b.Property("LogoUri") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("NonEditable") .HasColumnType("tinyint(1)"); b.Property("PairWiseSubjectSalt") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ProtocolType") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("RefreshTokenExpiration") .HasColumnType("int"); b.Property("RefreshTokenUsage") .HasColumnType("int"); b.Property("RequireClientSecret") .HasColumnType("tinyint(1)"); b.Property("RequireConsent") .HasColumnType("tinyint(1)"); b.Property("RequirePkce") .HasColumnType("tinyint(1)"); b.Property("RequireRequestObject") .HasColumnType("tinyint(1)"); b.Property("SlidingRefreshTokenLifetime") .HasColumnType("int"); b.Property("UpdateAccessTokenClaimsOnRefresh") .HasColumnType("tinyint(1)"); b.Property("Updated") .HasColumnType("datetime(6)"); b.Property("UserCodeType") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("UserSsoLifetime") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("ClientId") .IsUnique(); b.ToTable("Clients"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Origin") .IsRequired() .HasColumnType("varchar(150) CHARACTER SET utf8mb4") .HasMaxLength(150); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientCorsOrigins"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("GrantType") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientGrantTypes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Provider") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientIdPRestrictions"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("PostLogoutRedirectUri") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientPostLogoutRedirectUris"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("RedirectUri") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientRedirectUris"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Scope") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientScopes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("ClientId") .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.Property("Expiration") .HasColumnType("datetime(6)"); b.Property("Type") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(4000); b.HasKey("Id"); b.HasIndex("ClientId"); b.ToTable("ClientSecrets"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("Created") .HasColumnType("datetime(6)"); b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); b.Property("DisplayName") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Emphasize") .HasColumnType("tinyint(1)"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("Name") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("NonEditable") .HasColumnType("tinyint(1)"); b.Property("Required") .HasColumnType("tinyint(1)"); b.Property("ShowInDiscoveryDocument") .HasColumnType("tinyint(1)"); b.Property("Updated") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.HasIndex("Name") .IsUnique(); b.ToTable("IdentityResources"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("IdentityResourceId") .HasColumnType("int"); b.Property("Type") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("Id"); b.HasIndex("IdentityResourceId"); b.ToTable("IdentityResourceClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); b.Property("IdentityResourceId") .HasColumnType("int"); b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Value") .IsRequired() .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("IdentityResourceId"); b.ToTable("IdentityResourceProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("UserClaims") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Properties") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Scopes") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Secrets") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") .WithMany("UserClaims") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") .WithMany("Properties") .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("Claims") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("AllowedCorsOrigins") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("AllowedGrantTypes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("IdentityProviderRestrictions") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("PostLogoutRedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("Properties") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("RedirectUris") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("AllowedScopes") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") .WithMany("ClientSecrets") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("UserClaims") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("Properties") .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/IdentityServer/PersistedGrantDb/20200509165052_InitialIdentityServerPersistedGrantDbMigrationMysql.Designer.cs ================================================ // using System; using IdentityServer4.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Blog.IdentityServer.Data.MigrationsMySql.IdentityServer.PersistedGrantDb { [DbContext(typeof(PersistedGrantDbContext))] [Migration("20200509165052_InitialIdentityServerPersistedGrantDbMigrationMysql")] partial class InitialIdentityServerPersistedGrantDbMigrationMysql { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.3") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => { b.Property("UserCode") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientId") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("CreationTime") .HasColumnType("datetime(6)"); b.Property("Data") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(50000); b.Property("DeviceCode") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Expiration") .IsRequired() .HasColumnType("datetime(6)"); b.Property("SubjectId") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("UserCode"); b.HasIndex("DeviceCode") .IsUnique(); b.HasIndex("Expiration"); b.ToTable("DeviceCodes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => { b.Property("Key") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientId") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("CreationTime") .HasColumnType("datetime(6)"); b.Property("Data") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(50000); b.Property("Expiration") .HasColumnType("datetime(6)"); b.Property("SubjectId") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Type") .IsRequired() .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.HasKey("Key"); b.HasIndex("Expiration"); b.HasIndex("SubjectId", "ClientId", "Type"); b.ToTable("PersistedGrants"); }); #pragma warning restore 612, 618 } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/IdentityServer/PersistedGrantDb/20200509165052_InitialIdentityServerPersistedGrantDbMigrationMysql.cs ================================================ using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Blog.IdentityServer.Data.MigrationsMySql.IdentityServer.PersistedGrantDb { public partial class InitialIdentityServerPersistedGrantDbMigrationMysql : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "DeviceCodes", columns: table => new { UserCode = table.Column(maxLength: 200, nullable: false), DeviceCode = table.Column(maxLength: 200, nullable: false), SubjectId = table.Column(maxLength: 200, nullable: true), ClientId = table.Column(maxLength: 200, nullable: false), CreationTime = table.Column(nullable: false), Expiration = table.Column(nullable: false), Data = table.Column(maxLength: 50000, nullable: false) }, constraints: table => { table.PrimaryKey("PK_DeviceCodes", x => x.UserCode); }); migrationBuilder.CreateTable( name: "PersistedGrants", columns: table => new { Key = table.Column(maxLength: 200, nullable: false), Type = table.Column(maxLength: 50, nullable: false), SubjectId = table.Column(maxLength: 200, nullable: true), ClientId = table.Column(maxLength: 200, nullable: false), CreationTime = table.Column(nullable: false), Expiration = table.Column(nullable: true), Data = table.Column(maxLength: 50000, nullable: false) }, constraints: table => { table.PrimaryKey("PK_PersistedGrants", x => x.Key); }); migrationBuilder.CreateIndex( name: "IX_DeviceCodes_DeviceCode", table: "DeviceCodes", column: "DeviceCode", unique: true); migrationBuilder.CreateIndex( name: "IX_DeviceCodes_Expiration", table: "DeviceCodes", column: "Expiration"); migrationBuilder.CreateIndex( name: "IX_PersistedGrants_Expiration", table: "PersistedGrants", column: "Expiration"); migrationBuilder.CreateIndex( name: "IX_PersistedGrants_SubjectId_ClientId_Type", table: "PersistedGrants", columns: new[] { "SubjectId", "ClientId", "Type" }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "DeviceCodes"); migrationBuilder.DropTable( name: "PersistedGrants"); } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/IdentityServer/PersistedGrantDb/20200715032957_InitPersistedGrantDbV4.Designer.cs ================================================ // using System; using IdentityServer4.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Blog.IdentityServer.Data.MigrationsMySql.IdentityServer.PersistedGrantDb { [DbContext(typeof(PersistedGrantDbContext))] [Migration("20200715032957_InitPersistedGrantDbV4")] partial class InitPersistedGrantDbV4 { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.5") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => { b.Property("UserCode") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientId") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("CreationTime") .HasColumnType("datetime(6)"); b.Property("Data") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(50000); b.Property("Description") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("DeviceCode") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Expiration") .IsRequired() .HasColumnType("datetime(6)"); b.Property("SessionId") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("SubjectId") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("UserCode"); b.HasIndex("DeviceCode") .IsUnique(); b.HasIndex("Expiration"); b.ToTable("DeviceCodes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => { b.Property("Key") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientId") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ConsumedTime") .HasColumnType("datetime(6)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); b.Property("Data") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(50000); b.Property("Description") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Expiration") .HasColumnType("datetime(6)"); b.Property("SessionId") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("SubjectId") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Type") .IsRequired() .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.HasKey("Key"); b.HasIndex("Expiration"); b.HasIndex("SubjectId", "ClientId", "Type"); b.HasIndex("SubjectId", "SessionId", "Type"); b.ToTable("PersistedGrants"); }); #pragma warning restore 612, 618 } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/IdentityServer/PersistedGrantDb/20200715032957_InitPersistedGrantDbV4.cs ================================================ using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Blog.IdentityServer.Data.MigrationsMySql.IdentityServer.PersistedGrantDb { public partial class InitPersistedGrantDbV4 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "ConsumedTime", table: "PersistedGrants", nullable: true); migrationBuilder.AddColumn( name: "Description", table: "PersistedGrants", maxLength: 200, nullable: true); migrationBuilder.AddColumn( name: "SessionId", table: "PersistedGrants", maxLength: 100, nullable: true); migrationBuilder.AddColumn( name: "Description", table: "DeviceCodes", maxLength: 200, nullable: true); migrationBuilder.AddColumn( name: "SessionId", table: "DeviceCodes", maxLength: 100, nullable: true); migrationBuilder.CreateIndex( name: "IX_PersistedGrants_SubjectId_SessionId_Type", table: "PersistedGrants", columns: new[] { "SubjectId", "SessionId", "Type" }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropIndex( name: "IX_PersistedGrants_SubjectId_SessionId_Type", table: "PersistedGrants"); migrationBuilder.DropColumn( name: "ConsumedTime", table: "PersistedGrants"); migrationBuilder.DropColumn( name: "Description", table: "PersistedGrants"); migrationBuilder.DropColumn( name: "SessionId", table: "PersistedGrants"); migrationBuilder.DropColumn( name: "Description", table: "DeviceCodes"); migrationBuilder.DropColumn( name: "SessionId", table: "DeviceCodes"); } } } ================================================ FILE: Blog.IdentityServer/Data/MigrationsMySql/IdentityServer/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs ================================================ // using System; using IdentityServer4.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Blog.IdentityServer.Data.MigrationsMySql.IdentityServer.PersistedGrantDb { [DbContext(typeof(PersistedGrantDbContext))] partial class PersistedGrantDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.5") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => { b.Property("UserCode") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientId") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("CreationTime") .HasColumnType("datetime(6)"); b.Property("Data") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(50000); b.Property("Description") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("DeviceCode") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Expiration") .IsRequired() .HasColumnType("datetime(6)"); b.Property("SessionId") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("SubjectId") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.HasKey("UserCode"); b.HasIndex("DeviceCode") .IsUnique(); b.HasIndex("Expiration"); b.ToTable("DeviceCodes"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => { b.Property("Key") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ClientId") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("ConsumedTime") .HasColumnType("datetime(6)"); b.Property("CreationTime") .HasColumnType("datetime(6)"); b.Property("Data") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(50000); b.Property("Description") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Expiration") .HasColumnType("datetime(6)"); b.Property("SessionId") .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("SubjectId") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("Type") .IsRequired() .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.HasKey("Key"); b.HasIndex("Expiration"); b.HasIndex("SubjectId", "ClientId", "Type"); b.HasIndex("SubjectId", "SessionId", "Type"); b.ToTable("PersistedGrants"); }); #pragma warning restore 612, 618 } } } ================================================ FILE: Blog.IdentityServer/Dockerfile ================================================ FROM swr.cn-south-1.myhuaweicloud.com/mcr/aspnet:3.1-alpine WORKDIR /app COPY . . EXPOSE 5004 ENTRYPOINT ["dotnet", "Blog.IdentityServer.dll","-b","0.0.0.0"] ================================================ FILE: Blog.IdentityServer/Extensions/GrantTypeCustom.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Blog.IdentityServer.Extensions { /// /// 自定义授权类型 /// public class GrantTypeCustom { /// /// GrantType - 自定义微信授权 /// public const string ResourceWeixinOpen = "weixinopen"; } } ================================================ FILE: Blog.IdentityServer/Extensions/IpLimitMildd.cs ================================================ using AspNetCoreRateLimit; using Microsoft.AspNetCore.Builder; using System; namespace Blog.IdentityServer.Extensions { public static class IpLimitMildd { public static void UseIpLimitMildd(this IApplicationBuilder app) { if (app == null) throw new ArgumentNullException(nameof(app)); try { app.UseIpRateLimiting(); } catch (Exception e) { throw; } } } } ================================================ FILE: Blog.IdentityServer/Extensions/IpPolicyRateLimitSetup.cs ================================================ using AspNetCoreRateLimit; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System; namespace Blog.IdentityServer.Extensions { public static class IpPolicyRateLimitSetup { public static void AddIpPolicyRateLimitSetup(this IServiceCollection services, IConfiguration Configuration) { if (services == null) throw new ArgumentNullException(nameof(services)); // needed to store rate limit counters and ip rules services.AddMemoryCache(); //load general configuration from appsettings.json services.Configure(Configuration.GetSection("IpRateLimiting")); // inject counter and rules stores services.AddSingleton(); services.AddSingleton(); // inject counter and rules distributed cache stores //services.AddSingleton(); //services.AddSingleton(); // the clientId/clientIp resolvers use it. services.AddSingleton(); // configuration (resolvers, counter key builders) services.AddSingleton(); } } } ================================================ FILE: Blog.IdentityServer/Extensions/ResourceOwnerPasswordValidator.cs ================================================ using Blog.IdentityServer.Models; using IdentityServer4.Validation; using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; namespace Blog.IdentityServer.Extensions { public class ResourceOwnerPasswordValidator : IResourceOwnerPasswordValidator { public async Task ValidateAsync(ResourceOwnerPasswordValidationContext context) { try { var userName = context.UserName; var password = context.Password; //验证用户,这么可以到数据库里面验证用户名和密码是否正确 var claimList = await ValidateUserAsync(userName, password); // 验证账号 context.Result = new GrantValidationResult ( subject: userName, authenticationMethod: "custom", claims: claimList.ToArray() ); } catch (Exception ex) { //验证异常结果 context.Result = new GrantValidationResult() { IsError = true, Error = ex.Message }; } } /// /// 验证用户 /// /// /// /// private async Task> ValidateUserAsync(string loginName, string password) { var user = new ApplicationUser(); await Task.Run(() => { // TODO }); if (user == null) throw new Exception("登录失败,用户名和密码不正确"); return new List() { new Claim(ClaimTypes.Name, $"{loginName}"), }; } } } ================================================ FILE: Blog.IdentityServer/Extensions/WeiXinOpenGrantValidator.cs ================================================ using Blog.IdentityServer.Models; using IdentityServer4.Validation; using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; namespace Blog.IdentityServer.Extensions { public class WeiXinOpenGrantValidator : IExtensionGrantValidator { public string GrantType => GrantTypeCustom.ResourceWeixinOpen; public async Task ValidateAsync(ExtensionGrantValidationContext context) { try { // 参数获取 var openId = context.Request.Raw["openid"]; var unionId = context.Request.Raw["unionid"]; var userName = context.Request.Raw["user_name"]; // 通过openId和unionId 参数来进行数据库的相关验证 var claimList = await ValidateUserAsync(openId, unionId); //授权通过返回 context.Result = new GrantValidationResult ( subject: openId, authenticationMethod: "custom", claims: claimList.ToArray() ); } catch (Exception ex) { context.Result = new GrantValidationResult() { IsError = true, Error = ex.Message }; } } /// /// 验证用户 /// /// /// /// private async Task> ValidateUserAsync(string openId, string unionId) { // 数据库查询 var user = new ApplicationUser(); await Task.Run(() => { // TODO }); if (user == null) { //注册用户 } return new List() { new Claim(ClaimTypes.Name, $"{openId}"), }; } } } ================================================ FILE: Blog.IdentityServer/Helper/Appsettings.cs ================================================ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration.Json; using System; using System.IO; namespace Blog.Core.Common { /// /// appsettings.json操作类 /// public class Appsettings { static IConfiguration Configuration { get; set; } //static Appsettings() //{ // //ReloadOnChange = true 当appsettings.json被修改时重新加载 // Configuration = new ConfigurationBuilder() // .Add(new JsonConfigurationSource { Path = "appsettings.json", ReloadOnChange = true })//请注意要把当前appsetting.json 文件->右键->属性->复制到输出目录->始终复制 // .Build(); //} static Appsettings() { string Path = "appsettings.json"; { //如果你把配置文件 是 根据环境变量来分开了,可以这样写 //Path = $"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json"; } //Configuration = new ConfigurationBuilder() //.Add(new JsonConfigurationSource { Path = Path, ReloadOnChange = true })//请注意要把当前appsetting.json 文件->右键->属性->复制到输出目录->始终复制 //.Build(); Configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .Add(new JsonConfigurationSource { Path = Path, Optional = false, ReloadOnChange = true })//这样的话,可以直接读目录里的json文件,而不是 bin 文件夹下的,所以不用修改复制属性 .Build(); } /// /// 封装要操作的字符 /// /// /// public static string app(params string[] sections) { try { var val = string.Empty; for (int i = 0; i < sections.Length; i++) { val += sections[i] + ":"; } return Configuration[val.TrimEnd(':')]; } catch (Exception) { return ""; } } } } ================================================ FILE: Blog.IdentityServer/Helper/FileHelper.cs ================================================ using System; using System.IO; using System.Text; namespace Blog.Core.Common.Helper { public class FileHelper : IDisposable { private bool _alreadyDispose = false; #region 构造函数 public FileHelper() { // // TODO: 在此处添加构造函数逻辑 // } ~FileHelper() { Dispose(); ; } protected virtual void Dispose(bool isDisposing) { if (_alreadyDispose) return; _alreadyDispose = true; } #endregion #region IDisposable 成员 public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion #region 取得文件后缀名 /**************************************** * 函数名称:GetPostfixStr * 功能说明:取得文件后缀名 * 参 数:filename:文件名称 * 调用示列: * string filename = "aaa.aspx"; * string s = EC.FileObj.GetPostfixStr(filename); *****************************************/ /// /// 取后缀名 /// /// 文件名 /// .gif|.html格式 public static string GetPostfixStr(string filename) { int start = filename.LastIndexOf("."); int length = filename.Length; string postfix = filename.Substring(start, length - start); return postfix; } #endregion #region 写文件 /**************************************** * 函数名称:WriteFile * 功能说明:写文件,会覆盖掉以前的内容 * 参 数:Path:文件路径,Strings:文本内容 * 调用示列: * string Path = Server.MapPath("Default2.aspx"); * string Strings = "这是我写的内容啊"; * EC.FileObj.WriteFile(Path,Strings); *****************************************/ /// /// 写文件 /// /// 文件路径 /// 文件内容 public static void WriteFile(string Path, string Strings) { if (!System.IO.File.Exists(Path)) { System.IO.FileStream f = System.IO.File.Create(Path); f.Close(); } System.IO.StreamWriter f2 = new System.IO.StreamWriter(Path, false, System.Text.Encoding.GetEncoding("gb2312")); f2.Write(Strings); f2.Close(); f2.Dispose(); } /// /// 写文件 /// /// 文件路径 /// 文件内容 /// 编码格式 public static void WriteFile(string Path, string Strings, Encoding encode) { if (!System.IO.File.Exists(Path)) { System.IO.FileStream f = System.IO.File.Create(Path); f.Close(); } System.IO.StreamWriter f2 = new System.IO.StreamWriter(Path, false, encode); f2.Write(Strings); f2.Close(); f2.Dispose(); } #endregion #region 读文件 /**************************************** * 函数名称:ReadFile * 功能说明:读取文本内容 * 参 数:Path:文件路径 * 调用示列: * string Path = Server.MapPath("Default2.aspx"); * string s = EC.FileObj.ReadFile(Path); *****************************************/ /// /// 读文件 /// /// 文件路径 /// public static string ReadFile(string Path) { string s = ""; if (!System.IO.File.Exists(Path)) s = "不存在相应的目录"; else { StreamReader f2 = new StreamReader(Path, System.Text.Encoding.GetEncoding("gb2312")); s = f2.ReadToEnd(); f2.Close(); f2.Dispose(); } return s; } /// /// 读文件 /// /// 文件路径 /// 编码格式 /// public static string ReadFile(string Path, Encoding encode) { string s = ""; if (!System.IO.File.Exists(Path)) s = "不存在相应的目录"; else { StreamReader f2 = new StreamReader(Path, encode); s = f2.ReadToEnd(); f2.Close(); f2.Dispose(); } return s; } #endregion #region 追加文件 /**************************************** * 函数名称:FileAdd * 功能说明:追加文件内容 * 参 数:Path:文件路径,strings:内容 * 调用示列: * string Path = Server.MapPath("Default2.aspx"); * string Strings = "新追加内容"; * EC.FileObj.FileAdd(Path, Strings); *****************************************/ /// /// 追加文件 /// /// 文件路径 /// 内容 public static void FileAdd(string Path, string strings) { StreamWriter sw = File.AppendText(Path); sw.Write(strings); sw.Flush(); sw.Close(); } #endregion #region 拷贝文件 /**************************************** * 函数名称:FileCoppy * 功能说明:拷贝文件 * 参 数:OrignFile:原始文件,NewFile:新文件路径 * 调用示列: * string orignFile = Server.MapPath("Default2.aspx"); * string NewFile = Server.MapPath("Default3.aspx"); * EC.FileObj.FileCoppy(OrignFile, NewFile); *****************************************/ /// /// 拷贝文件 /// /// 原始文件 /// 新文件路径 public static void FileCoppy(string orignFile, string NewFile) { File.Copy(orignFile, NewFile, true); } #endregion #region 删除文件 /**************************************** * 函数名称:FileDel * 功能说明:删除文件 * 参 数:Path:文件路径 * 调用示列: * string Path = Server.MapPath("Default3.aspx"); * EC.FileObj.FileDel(Path); *****************************************/ /// /// 删除文件 /// /// 路径 public static void FileDel(string Path) { File.Delete(Path); } #endregion #region 移动文件 /**************************************** * 函数名称:FileMove * 功能说明:移动文件 * 参 数:OrignFile:原始路径,NewFile:新文件路径 * 调用示列: * string orignFile = Server.MapPath("../说明.txt"); * string NewFile = Server.MapPath("http://www.cnblogs.com/说明.txt"); * EC.FileObj.FileMove(OrignFile, NewFile); *****************************************/ /// /// 移动文件 /// /// 原始路径 /// 新路径 public static void FileMove(string orignFile, string NewFile) { File.Move(orignFile, NewFile); } #endregion #region 在当前目录下创建目录 /**************************************** * 函数名称:FolderCreate * 功能说明:在当前目录下创建目录 * 参 数:OrignFolder:当前目录,NewFloder:新目录 * 调用示列: * string orignFolder = Server.MapPath("test/"); * string NewFloder = "new"; * EC.FileObj.FolderCreate(OrignFolder, NewFloder); *****************************************/ /// /// 在当前目录下创建目录 /// /// 当前目录 /// 新目录 public static void FolderCreate(string orignFolder, string NewFloder) { Directory.SetCurrentDirectory(orignFolder); Directory.CreateDirectory(NewFloder); } #endregion #region 递归删除文件夹目录及文件 /**************************************** * 函数名称:DeleteFolder * 功能说明:递归删除文件夹目录及文件 * 参 数:dir:文件夹路径 * 调用示列: * string dir = Server.MapPath("test/"); * EC.FileObj.DeleteFolder(dir); *****************************************/ /// /// 递归删除文件夹目录及文件 /// /// /// public static void DeleteFolder(string dir) { if (Directory.Exists(dir)) //如果存在这个文件夹删除之 { foreach (string d in Directory.GetFileSystemEntries(dir)) { if (File.Exists(d)) File.Delete(d); //直接删除其中的文件 else DeleteFolder(d); //递归删除子文件夹 } Directory.Delete(dir); //删除已空文件夹 } } #endregion #region 将指定文件夹下面的所有内容copy到目标文件夹下面 果目标文件夹为只读属性就会报错。 /**************************************** * 函数名称:CopyDir * 功能说明:将指定文件夹下面的所有内容copy到目标文件夹下面 果目标文件夹为只读属性就会报错。 * 参 数:srcPath:原始路径,aimPath:目标文件夹 * 调用示列: * string srcPath = Server.MapPath("test/"); * string aimPath = Server.MapPath("test1/"); * EC.FileObj.CopyDir(srcPath,aimPath); *****************************************/ /// /// 指定文件夹下面的所有内容copy到目标文件夹下面 /// /// 原始路径 /// 目标文件夹 public static void CopyDir(string srcPath, string aimPath) { try { // 检查目标目录是否以目录分割字符结束如果不是则添加之 if (aimPath[aimPath.Length - 1] != Path.DirectorySeparatorChar) aimPath += Path.DirectorySeparatorChar; // 判断目标目录是否存在如果不存在则新建之 if (!Directory.Exists(aimPath)) Directory.CreateDirectory(aimPath); // 得到源目录的文件列表,该里面是包含文件以及目录路径的一个数组 //如果你指向copy目标文件下面的文件而不包含目录请使用下面的方法 //string[] fileList = Directory.GetFiles(srcPath); string[] fileList = Directory.GetFileSystemEntries(srcPath); //遍历所有的文件和目录 foreach (string file in fileList) { //先当作目录处理如果存在这个目录就递归Copy该目录下面的文件 if (Directory.Exists(file)) CopyDir(file, aimPath + Path.GetFileName(file)); //否则直接Copy文件 else File.Copy(file, aimPath + Path.GetFileName(file), true); } } catch (Exception ee) { throw new Exception(ee.ToString()); } } #endregion } } ================================================ FILE: Blog.IdentityServer/Helper/GetNetData.cs ================================================ using System.IO; using System.Net; using System.Text; namespace Blog.Core.Common.Helper { public class GetNetData { public static string Get(string serviceAddress) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceAddress); request.Method = "GET"; request.ContentType = "text/html;charset=UTF-8"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream myResponseStream = response.GetResponseStream(); StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.UTF8); string retString = myStreamReader.ReadToEnd(); myStreamReader.Close(); myResponseStream.Close(); return retString; } public static string Post(string serviceAddress) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceAddress); request.Method = "POST"; request.ContentType = "application/json"; string strContent = @"{ ""mmmm"": ""89e"",""nnnnnn"": ""0101943"",""kkkkkkk"": ""e8sodijf9""}"; using (StreamWriter dataStream = new StreamWriter(request.GetRequestStream())) { dataStream.Write(strContent); dataStream.Close(); } HttpWebResponse response = (HttpWebResponse)request.GetResponse(); string encoding = response.ContentEncoding; if (encoding == null || encoding.Length < 1) { encoding = "UTF-8"; //默认编码 } StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding)); string retString = reader.ReadToEnd(); return retString; //解析josn //JObject jo = JObject.Parse(retString); //Response.Write(jo["message"]["mmmm"].ToString()); } } } ================================================ FILE: Blog.IdentityServer/Helper/HtmlHelper.cs ================================================ namespace Blog.Core.Common.Helper { public static class HtmlHelper { #region 去除富文本中的HTML标签 /// /// 去除富文本中的HTML标签 /// /// /// /// public static string ReplaceHtmlTag(string html, int length = 0) { string strText = System.Text.RegularExpressions.Regex.Replace(html, "<[^>]+>", ""); strText = System.Text.RegularExpressions.Regex.Replace(strText, "&[^;]+;", ""); if (length > 0 && strText.Length > length) return strText.Substring(0, length); return strText; } #endregion } } ================================================ FILE: Blog.IdentityServer/Helper/JsonHelper.cs ================================================ using System; using System.Collections.Generic; namespace Blog.Core.Common.Helper { public class JsonHelper { /// /// 转换对象为JSON格式数据 /// /// /// 对象 /// 字符格式的JSON数据 public static string GetJSON(object obj) { string result = String.Empty; try { System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(T)); using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { serializer.WriteObject(ms, obj); result = System.Text.Encoding.UTF8.GetString(ms.ToArray()); } } catch (Exception ex) { throw ex; } return result; } /// /// 转换List的数据为JSON格式 /// /// /// 列表值 /// JSON格式数据 public string JSON(List vals) { System.Text.StringBuilder st = new System.Text.StringBuilder(); try { System.Runtime.Serialization.Json.DataContractJsonSerializer s = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(T)); foreach (T city in vals) { using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { s.WriteObject(ms, city); st.Append(System.Text.Encoding.UTF8.GetString(ms.ToArray())); } } } catch (Exception ex) { throw ex; } return st.ToString(); } /// /// JSON格式字符转换为T类型的对象 /// /// /// /// public static T ParseFormByJson(string jsonStr) { T obj = Activator.CreateInstance(); using (System.IO.MemoryStream ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(jsonStr))) { System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(T)); return (T)serializer.ReadObject(ms); } } public string JSON1(List vals) { System.Text.StringBuilder st = new System.Text.StringBuilder(); try { System.Runtime.Serialization.Json.DataContractJsonSerializer s = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(SendData)); foreach (SendData city in vals) { using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { s.WriteObject(ms, city); st.Append(System.Text.Encoding.UTF8.GetString(ms.ToArray())); } } } catch (Exception ex) { throw ex; } return st.ToString(); } } } ================================================ FILE: Blog.IdentityServer/Helper/MD5Hepler.cs ================================================ using System; using System.Security.Cryptography; using System.Text; namespace Blog.Core.Common.Helper { public class MD5Helper { /// /// 16位MD5加密 /// /// /// public static string MD5Encrypt16(string password) { var md5 = new MD5CryptoServiceProvider(); string t2 = BitConverter.ToString(md5.ComputeHash(Encoding.Default.GetBytes(password)), 4, 8); t2 = t2.Replace("-", string.Empty); return t2; } /// /// 32位MD5加密 /// /// /// public static string MD5Encrypt32(string password = "") { string pwd = string.Empty; try { if (!string.IsNullOrEmpty(password) && !string.IsNullOrWhiteSpace(password)) { MD5 md5 = MD5.Create(); //实例化一个md5对像 // 加密后是一个字节类型的数组,这里要注意编码UTF8/Unicode等的选择  byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(password)); // 通过使用循环,将字节类型的数组转换为字符串,此字符串是常规字符格式化所得 foreach (var item in s) { // 将得到的字符串使用十六进制类型格式。格式后的字符是小写的字母,如果使用大写(X)则格式后的字符是大写字符 pwd = string.Concat(pwd, item.ToString("X2")); } } } catch { throw new Exception($"错误的 password 字符串:【{password}】"); } return pwd; } /// /// 64位MD5加密 /// /// /// public static string MD5Encrypt64(string password) { // 实例化一个md5对像 // 加密后是一个字节类型的数组,这里要注意编码UTF8/Unicode等的选择  MD5 md5 = MD5.Create(); byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(password)); return Convert.ToBase64String(s); } } } ================================================ FILE: Blog.IdentityServer/Helper/RecursionHelper.cs ================================================ using System.Collections.Generic; using System.Linq; namespace Blog.Core.Common.Helper { /// /// 泛型递归求树形结构 /// public static class RecursionHelper { public static void LoopToAppendChildren(List all, PermissionTree curItem, int pid, bool needbtn) { var subItems = all.Where(ee => ee.Pid == curItem.value).ToList(); var btnItems = subItems.Where(ss => ss.isbtn == true).ToList(); if (subItems.Count > 0) { curItem.btns = new List(); curItem.btns.AddRange(btnItems); } else { curItem.btns = null; } if (!needbtn) { subItems = subItems.Where(ss => ss.isbtn == false).ToList(); } if (subItems.Count > 0) { curItem.children = new List(); curItem.children.AddRange(subItems); } else { curItem.children = null; } if (curItem.isbtn) { //curItem.label += "按钮"; } foreach (var subItem in subItems) { if (subItem.value == pid && pid > 0) { //subItem.disabled = true;//禁用当前节点 } LoopToAppendChildren(all, subItem, pid, needbtn); } } public static void LoopNaviBarAppendChildren(List all, NavigationBar curItem) { var subItems = all.Where(ee => ee.pid == curItem.id).ToList(); if (subItems.Count > 0) { curItem.children = new List(); curItem.children.AddRange(subItems); } else { curItem.children = null; } foreach (var subItem in subItems) { LoopNaviBarAppendChildren(all, subItem); } } public static void LoopToAppendChildrenT(List all, T curItem, string parentIdName = "Pid", string idName = "value", string childrenName = "children") { var subItems = all.Where(ee => ee.GetType().GetProperty(parentIdName).GetValue(ee, null).ToString() == curItem.GetType().GetProperty(idName).GetValue(curItem, null).ToString()).ToList(); if (subItems.Count > 0) curItem.GetType().GetField(childrenName).SetValue(curItem, subItems); foreach (var subItem in subItems) { LoopToAppendChildrenT(all, subItem); } } } public class PermissionTree { public int value { get; set; } public int Pid { get; set; } public string label { get; set; } public int order { get; set; } public bool isbtn { get; set; } public bool disabled { get; set; } public List children { get; set; } public List btns { get; set; } } public class NavigationBar { public int id { get; set; } public int pid { get; set; } public int order { get; set; } public string name { get; set; } public string path { get; set; } public string iconCls { get; set; } public NavigationBarMeta meta { get; set; } public List children { get; set; } } public class NavigationBarMeta { public string title { get; set; } public bool requireAuth { get; set; } = true; } } ================================================ FILE: Blog.IdentityServer/Helper/SerializeHelper.cs ================================================ using Newtonsoft.Json; using System.Text; namespace Blog.Core.Common.Helper { public class SerializeHelper { /// /// 序列化 /// /// /// public static byte[] Serialize(object item) { var jsonString = JsonConvert.SerializeObject(item); return Encoding.UTF8.GetBytes(jsonString); } /// /// 反序列化 /// /// /// /// public static TEntity Deserialize(byte[] value) { if (value == null) { return default(TEntity); } var jsonString = Encoding.UTF8.GetString(value); return JsonConvert.DeserializeObject(jsonString); } } } ================================================ FILE: Blog.IdentityServer/Helper/UnicodeHelper.cs ================================================ using System; using System.Text; using System.Text.RegularExpressions; namespace Blog.Core.Common.Helper { public static class UnicodeHelper { /// /// 字符串转Unicode码 /// /// The to unicode. /// Value. public static string StringToUnicode(string value) { byte[] bytes = Encoding.Unicode.GetBytes(value); StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < bytes.Length; i += 2) { // 取两个字符,每个字符都是右对齐。 stringBuilder.AppendFormat("u{0}{1}", bytes[i + 1].ToString("x").PadLeft(2, '0'), bytes[i].ToString("x").PadLeft(2, '0')); } return stringBuilder.ToString(); } /// /// Unicode转字符串 /// /// The to string. /// Unicode. public static string UnicodeToString(string unicode) { unicode = unicode.Replace("%", "\\"); return new Regex(@"\\u([0-9A-F]{4})", RegexOptions.IgnoreCase | RegexOptions.Compiled).Replace( unicode, x => string.Empty + Convert.ToChar(Convert.ToUInt16(x.Result("$1"), 16))); } } } ================================================ FILE: Blog.IdentityServer/Helper/UtilConvert.cs ================================================ using System; namespace Blog.IdentityServer { /// /// /// public static class UtilConvert { /// /// /// /// /// public static int ObjToInt(this object thisValue) { int reval = 0; if (thisValue == null) return 0; if (thisValue != null && thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval)) { return reval; } return reval; } /// /// /// /// /// /// public static int ObjToInt(this object thisValue, int errorValue) { int reval = 0; if (thisValue != null && thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval)) { return reval; } return errorValue; } /// /// /// /// /// public static double ObjToMoney(this object thisValue) { double reval = 0; if (thisValue != null && thisValue != DBNull.Value && double.TryParse(thisValue.ToString(), out reval)) { return reval; } return 0; } /// /// /// /// /// /// public static double ObjToMoney(this object thisValue, double errorValue) { double reval = 0; if (thisValue != null && thisValue != DBNull.Value && double.TryParse(thisValue.ToString(), out reval)) { return reval; } return errorValue; } /// /// /// /// /// public static string ObjToString(this object thisValue) { if (thisValue != null) return thisValue.ToString().Trim(); return ""; } /// /// /// /// /// /// public static string ObjToString(this object thisValue, string errorValue) { if (thisValue != null) return thisValue.ToString().Trim(); return errorValue; } /// /// /// /// /// public static Decimal ObjToDecimal(this object thisValue) { Decimal reval = 0; if (thisValue != null && thisValue != DBNull.Value && decimal.TryParse(thisValue.ToString(), out reval)) { return reval; } return 0; } /// /// /// /// /// /// public static Decimal ObjToDecimal(this object thisValue, decimal errorValue) { Decimal reval = 0; if (thisValue != null && thisValue != DBNull.Value && decimal.TryParse(thisValue.ToString(), out reval)) { return reval; } return errorValue; } /// /// /// /// /// public static DateTime ObjToDate(this object thisValue) { DateTime reval = DateTime.MinValue; if (thisValue != null && thisValue != DBNull.Value && DateTime.TryParse(thisValue.ToString(), out reval)) { reval = Convert.ToDateTime(thisValue); } return reval; } /// /// /// /// /// /// public static DateTime ObjToDate(this object thisValue, DateTime errorValue) { DateTime reval = DateTime.MinValue; if (thisValue != null && thisValue != DBNull.Value && DateTime.TryParse(thisValue.ToString(), out reval)) { return reval; } return errorValue; } /// /// /// /// /// public static bool ObjToBool(this object thisValue) { bool reval = false; if (thisValue != null && thisValue != DBNull.Value && bool.TryParse(thisValue.ToString(), out reval)) { return reval; } return reval; } } } ================================================ FILE: Blog.IdentityServer/InMemoryConfig.cs ================================================ using IdentityServer4.Models; using IdentityServer4.Test; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Blog.IdentityServer { public static class InMemoryConfig { // 这个 Authorization Server 保护了哪些 API (资源) public static IEnumerable GetApiResources() { return new[] { new ApiResource("blog.core.api", "Blog.Core API") }; } // 哪些客户端 Client(应用) 可以使用这个 Authorization Server public static IEnumerable GetClients() { return new[] { new Client { ClientId = "blogvuejs",//定义客户端 Id ClientSecrets = new [] { new Secret("secret".Sha256()) },//Client用来获取token AllowedGrantTypes = GrantTypes.ResourceOwnerPasswordAndClientCredentials,//这里使用的是通过用户名密码和ClientCredentials来换取token的方式. ClientCredentials允许Client只使用ClientSecrets来获取token. 这比较适合那种没有用户参与的api动作 AllowedScopes = new [] { "blog.core.api" }// 允许访问的 API 资源 } }; } // 指定可以使用 Authorization Server 授权的 Users(用户) public static IEnumerable Users() { return new[] { new TestUser { SubjectId = "1", Username = "laozhang", Password = "laozhang" } }; } } } ================================================ FILE: Blog.IdentityServer/LICENSE ================================================ MIT License Copyright (c) 2019 ansonzhang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Blog.IdentityServer/Models/ApplicationRole.cs ================================================ using Microsoft.AspNetCore.Identity; using System; using System.Collections.Generic; namespace Blog.IdentityServer.Models { // Add profile data for application roles by adding properties to the ApplicationRole class public class ApplicationRole : IdentityRole { public bool IsDeleted { get; set; } public string Description { get; set; } /// ///排序 /// public int OrderSort { get; set; } /// /// 是否激活 /// public bool Enabled { get; set; } /// /// 创建ID /// public int? CreateId { get; set; } /// /// 创建者 /// public string CreateBy { get; set; } /// /// 创建时间 /// public DateTime? CreateTime { get; set; } = DateTime.Now; /// /// 修改ID /// public int? ModifyId { get; set; } /// /// 修改者 /// public string ModifyBy { get; set; } /// /// 修改时间 /// public DateTime? ModifyTime { get; set; } = DateTime.Now; public ICollection UserRoles { get; set; } } } ================================================ FILE: Blog.IdentityServer/Models/ApplicationUser.cs ================================================ using Microsoft.AspNetCore.Identity; using System; using System.Collections.Generic; namespace Blog.IdentityServer.Models { // Add profile data for application users by adding properties to the ApplicationUser class public class ApplicationUser : IdentityUser { public string LoginName { get; set; } public string RealName { get; set; } public int sex { get; set; } = 0; public int age { get; set; } public DateTime birth { get; set; } = DateTime.Now; public string addr { get; set; } public string FirstQuestion { get; set; } public string SecondQuestion { get; set; } public bool tdIsDelete { get; set; } public ICollection UserRoles { get; set; } } } ================================================ FILE: Blog.IdentityServer/Models/ApplicationUserRole.cs ================================================ using Microsoft.AspNetCore.Identity; namespace Blog.IdentityServer.Models { public class ApplicationUserRole : IdentityUserRole { public virtual ApplicationUser User { get; set; } public virtual ApplicationRole Role { get; set; } } } ================================================ FILE: Blog.IdentityServer/Models/Bak/Role.cs ================================================ using System; namespace Blog.IdentityServer.Models { /// /// 角色表 /// public class Role : RootEntity { public Role() { OrderSort = 1; CreateTime = DateTime.Now; ModifyTime = DateTime.Now; IsDeleted = false; } public Role(string name) { Name = name; Description = ""; OrderSort = 1; Enabled = true; CreateTime = DateTime.Now; ModifyTime = DateTime.Now; } /// ///获取或设置是否禁用,逻辑上的删除,非物理删除 /// public bool? IsDeleted { get; set; } /// /// 角色名 /// public string Name { get; set; } /// ///描述 /// public string Description { get; set; } /// ///排序 /// public int OrderSort { get; set; } /// /// 是否激活 /// public bool Enabled { get; set; } /// /// 创建ID /// public int? CreateId { get; set; } /// /// 创建者 /// public string CreateBy { get; set; } /// /// 创建时间 /// public DateTime? CreateTime { get; set; } = DateTime.Now; /// /// 修改ID /// public int? ModifyId { get; set; } /// /// 修改者 /// public string ModifyBy { get; set; } /// /// 修改时间 /// public DateTime? ModifyTime { get; set; } = DateTime.Now; } } ================================================ FILE: Blog.IdentityServer/Models/Bak/RootEntity.cs ================================================ namespace Blog.IdentityServer.Models { public class RootEntity { /// /// ID /// public int Id { get; set; } } } ================================================ FILE: Blog.IdentityServer/Models/Bak/UserRole.cs ================================================ using System; namespace Blog.IdentityServer.Models { /// /// 用户跟角色关联表 /// public class UserRole : RootEntity { public UserRole() { } public UserRole(int uid, int rid) { UserId = uid; RoleId = rid; CreateTime = DateTime.Now; IsDeleted = false; CreateId = uid; CreateTime = DateTime.Now; } /// ///获取或设置是否禁用,逻辑上的删除,非物理删除 /// public bool? IsDeleted { get; set; } /// /// 用户ID /// public int UserId { get; set; } /// /// 角色ID /// public int RoleId { get; set; } /// /// 创建ID /// public int? CreateId { get; set; } /// /// 创建者 /// public string CreateBy { get; set; } /// /// 创建时间 /// public DateTime? CreateTime { get; set; } /// /// 修改ID /// public int? ModifyId { get; set; } /// /// 修改者 /// public string ModifyBy { get; set; } /// /// 修改时间 /// public DateTime? ModifyTime { get; set; } } } ================================================ FILE: Blog.IdentityServer/Models/Bak/sysUserInfo.cs ================================================ using System; namespace Blog.IdentityServer.Models { /// /// 用户信息表 /// public class sysUserInfo { public sysUserInfo() { } public sysUserInfo(string loginName, string loginPWD) { uLoginName = loginName; uLoginPWD = loginPWD; uRealName = uLoginName; uStatus = 0; uCreateTime = DateTime.Now; uUpdateTime = DateTime.Now; uLastErrTime = DateTime.Now; uErrorCount = 0; name = ""; } /// /// 用户ID /// public int uID { get; set; } /// /// 登录账号 /// public string uLoginName { get; set; } /// /// 登录密码 /// public string uLoginPWD { get; set; } /// /// 真实姓名 /// public string uRealName { get; set; } /// /// 状态 /// public int uStatus { get; set; } /// /// 备注 /// public string uRemark { get; set; } /// /// 创建时间 /// public System.DateTime uCreateTime { get; set; } = DateTime.Now; /// /// 更新时间 /// public System.DateTime uUpdateTime { get; set; } = DateTime.Now; /// ///最后登录时间 /// public DateTime uLastErrTime { get; set; }= DateTime.Now; /// ///错误次数 /// public int uErrorCount { get; set; } /// /// 登录账号 /// public string name { get; set; } // 性别 public int sex { get; set; } = 0; // 年龄 public int age { get; set; } // 生日 public DateTime birth { get; set; } = DateTime.Now; // 地址 public string addr { get; set; } public bool tdIsDelete { get; set; } } } ================================================ FILE: Blog.IdentityServer/Models/Dtos/MessageModel.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Blog.IdentityServer.Models { /// /// 通用返回信息类 /// public class MessageModel { /// /// 状态码 /// public int status { get; set; } = 200; /// /// 操作是否成功 /// public bool success { get; set; } = false; /// /// 返回信息 /// public string msg { get; set; } = "服务器异常"; /// /// 返回数据集合 /// public T response { get; set; } } } ================================================ FILE: Blog.IdentityServer/Models/ViewModel/AccessApiDateView.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Blog.IdentityServer.Models.ViewModel { public class AccessApiDateView { public int today { get; set; } public string[] columns { get; set; } public List rows { get; set; } } public class ApiDate { public string date { get; set; } public int count { get; set; } } } ================================================ FILE: Blog.IdentityServer/Program.cs ================================================ using System; using System.Linq; using Blog.IdentityServer; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Serilog; using Serilog.Events; using Serilog.Sinks.SystemConsole.Themes; namespace Blog.IdentityServer { public class Program { public static void Main(string[] args) { Console.Title = "IdentityServerWithEfAndAspNetIdentity"; Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) .MinimumLevel.Override("System", LogEventLevel.Warning) .MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Information) .Enrich.FromLogContext() .WriteTo.File(@"Logs/identityserver4_log.txt") .WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Literate) .CreateLogger(); var seed = args.Contains("/seed"); if (seed) { args = args.Except(new[] { "/seed" }).ToArray(); } var host = CreateHostBuilder(args).Build(); if (seed) { SeedData.EnsureSeedData(host.Services); } host.Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder .ConfigureKestrel(serverOptions => { serverOptions.AllowSynchronousIO = true;//启用同步 IO }) .UseStartup() .UseUrls("http://*:5004") .ConfigureLogging((hostingContext, builder) => { builder.ClearProviders(); builder.SetMinimumLevel(LogLevel.Trace); builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddConsole(); builder.AddDebug(); }); }); } } ================================================ FILE: Blog.IdentityServer/Properties/PublishProfiles/FolderProfile.pubxml ================================================ FileSystem FileSystem Release Any CPU True False 1db65298-136c-41bc-b2cd-ba5bba3d7a23 bin\Release\netcoreapp3.0\publish\ False ================================================ FILE: Blog.IdentityServer/Properties/launchSettings.json ================================================ { "profiles": { "Blog.IdentityServer": { "commandName": "Project", "launchBrowser": true, "launchUrl": "http://localhost:5004", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, "Docker": { "commandName": "Docker", "launchBrowser": true, "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/", "publishAllPorts": true } } } ================================================ FILE: Blog.IdentityServer/SameSiteHandlingExtensions.cs ================================================ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; namespace Blog.IdentityServer { // copied from https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/ public static class SameSiteHandlingExtensions { public static IServiceCollection AddSameSiteCookiePolicy(this IServiceCollection services) { services.Configure(options => { options.MinimumSameSitePolicy = SameSiteMode.Unspecified; options.OnAppendCookie = cookieContext => CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); options.OnDeleteCookie = cookieContext => CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); }); return services; } private static void CheckSameSite(HttpContext httpContext, CookieOptions options) { if (options.SameSite == SameSiteMode.None) { var userAgent = httpContext.Request.Headers["User-Agent"].ToString(); if (DisallowsSameSiteNone(userAgent)) { // For .NET Core < 3.1 set SameSite = (SameSiteMode)(-1) options.SameSite = SameSiteMode.Unspecified; } } } private static bool DisallowsSameSiteNone(string userAgent) { // Cover all iOS based browsers here. This includes: // - Safari on iOS 12 for iPhone, iPod Touch, iPad // - WkWebview on iOS 12 for iPhone, iPod Touch, iPad // - Chrome on iOS 12 for iPhone, iPod Touch, iPad // All of which are broken by SameSite=None, because they use the iOS networking stack if (userAgent.Contains("CPU iPhone OS 12") || userAgent.Contains("iPad; CPU OS 12")) { return true; } // Cover Mac OS X based browsers that use the Mac OS networking stack. This includes: // - Safari on Mac OS X. // This does not include: // - Chrome on Mac OS X // Because they do not use the Mac OS networking stack. if (userAgent.Contains("Macintosh; Intel Mac OS X 10_14") && userAgent.Contains("Version/") && userAgent.Contains("Safari")) { return true; } // Cover Chrome 50-69, because some versions are broken by SameSite=None, // and none in this range require it. // Note: this covers some pre-Chromium Edge versions, // but pre-Chromium Edge does not require SameSite=None. if (userAgent.Contains("Chrome")) { return true; } return false; } } } ================================================ FILE: Blog.IdentityServer/SeedData.cs ================================================ using System; using System.Linq; using System.Security.Claims; using IdentityModel; using IdentityServer4.EntityFramework.DbContexts; using IdentityServer4.EntityFramework.Mappers; using Blog.IdentityServer; using Blog.IdentityServer.Data; using Blog.IdentityServer.Models; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Blog.Core.Common.Helper; using System.Collections.Generic; using System.Text; namespace Blog.IdentityServer { public class SeedData { private static string GitJsonFileFormat = "https://gitee.com/laozhangIsPhi/Blog.Data.Share/raw/master/BlogCore.Data.json/{0}.tsv"; public static void EnsureSeedData(IServiceProvider serviceProvider) { /* * 1、本项目同时支持Mysql和Sqlserver,默认Mysql,迁移文件已经配置好,在Data文件夹下, * 直接执行三步 update-database xxxxcontext 即可。 * update-database -c PersistedGrantDbContext * update-database -c ConfigurationDbContext * update-database -c ApplicationDbContext * * 2、如果自己处理,删掉data下的MigrationsMySql文件夹 * 如果你使用sqlserver,可以先从迁移开始,下边有步骤 * 当然你也可以都删掉,自己重新做迁移。 * * 3、迁移完成后,执行dotnet run /seed * * * 1、PM> add-migration InitialIdentityServerPersistedGrantDbMigrationMysql -c PersistedGrantDbContext -o Data/MigrationsMySql/IdentityServer/PersistedGrantDb Build started... Build succeeded. To undo this action, use Remove-Migration. 2、PM> update-database -c PersistedGrantDbContext Build started... Build succeeded. Applying migration '20200509165052_InitialIdentityServerPersistedGrantDbMigrationMysql'. Done. 3、PM> add-migration InitialIdentityServerConfigurationDbMigrationMysql -c ConfigurationDbContext -o Data/MigrationsMySql/IdentityServer/ConfigurationDb Build started... Build succeeded. To undo this action, use Remove-Migration. 4、PM> update-database -c ConfigurationDbContext Build started... Build succeeded. Applying migration '20200509165153_InitialIdentityServerConfigurationDbMigrationMysql'. Done. 5、PM> add-migration AppDbMigration -c ApplicationDbContext -o Data/MigrationsMySql Build started... Build succeeded. To undo this action, use Remove-Migration. 6、PM> update-database -c ApplicationDbContext Build started... Build succeeded. Applying migration '20200509165505_AppDbMigration'. Done. * */ Console.WriteLine("Seeding database..."); using (var scope = serviceProvider.GetRequiredService().CreateScope()) { scope.ServiceProvider.GetRequiredService().Database.Migrate(); { var context = scope.ServiceProvider.GetRequiredService(); context.Database.Migrate(); EnsureSeedData(context); } { var context = scope.ServiceProvider.GetService(); context.Database.Migrate(); var userMgr = scope.ServiceProvider.GetRequiredService>(); var roleMgr = scope.ServiceProvider.GetRequiredService>(); var BlogCore_Users = JsonHelper.ParseFormByJson>(GetNetData.Get(string.Format(GitJsonFileFormat, "sysUserInfo"))); var BlogCore_Roles = JsonHelper.ParseFormByJson>(GetNetData.Get(string.Format(GitJsonFileFormat, "Role"))); var BlogCore_UserRoles = JsonHelper.ParseFormByJson>(GetNetData.Get(string.Format(GitJsonFileFormat, "UserRole"))); foreach (var user in BlogCore_Users) { if (user == null || user.uLoginName == null) { continue; } var userItem = userMgr.FindByNameAsync(user.uLoginName).Result; var rid = BlogCore_UserRoles.FirstOrDefault(d => d.UserId == user.uID)?.RoleId; var rName = BlogCore_Roles.Where(d => d.Id == rid).Select(d=>d.Id).ToList(); var roleName = BlogCore_Roles.FirstOrDefault(d => d.Id == rid)?.Name; if (userItem == null) { if (rid > 0 && rName.Count>0) { userItem = new ApplicationUser { UserName = user.uLoginName, LoginName = user.uLoginName, sex = user.sex, age = user.age, birth = user.birth, addr = user.addr, tdIsDelete = user.tdIsDelete, Email = user.uLoginName + "@email.com", EmailConfirmed=true, RealName=user.uRealName, }; //var result = userMgr.CreateAsync(userItem, "BlogIdp123$" + item.uLoginPWD).Result; // 因为导入的密码是 MD5密文,所以这里统一都用初始密码了,可以先登录,然后修改密码,超级管理员:blogadmin var result = userMgr.CreateAsync(userItem, "BlogIdp123$InitPwd").Result; if (!result.Succeeded) { throw new Exception(result.Errors.First().Description); } var claims = new List{ new Claim(JwtClaimTypes.Name, user.uRealName), new Claim(JwtClaimTypes.Email, $"{user.uLoginName}@email.com"), new Claim("rolename", roleName), }; claims.AddRange(rName.Select(s => new Claim(JwtClaimTypes.Role, s.ToString()))); result = userMgr.AddClaimsAsync(userItem,claims ).Result; if (!result.Succeeded) { throw new Exception(result.Errors.First().Description); } Console.WriteLine($"{userItem?.UserName} created");//AspNetUserClaims 表 } else { Console.WriteLine($"{user?.uLoginName} doesn't have a corresponding role."); } } else { Console.WriteLine($"{userItem?.UserName} already exists"); } } foreach (var role in BlogCore_Roles) { if (role == null || role.Name == null) { continue; } var roleItem = roleMgr.FindByNameAsync(role.Name).Result; if (roleItem != null) { role.Name = role.Name + Guid.NewGuid().ToString("N"); } roleItem = new ApplicationRole { CreateBy = role.CreateBy, Description = role.Description, IsDeleted = role.IsDeleted != null ? (bool)role.IsDeleted : true, CreateId = role.CreateId, CreateTime = role.CreateTime, Enabled = role.Enabled, Name = role.Name, OrderSort = role.OrderSort, }; var result = roleMgr.CreateAsync(roleItem).Result; if (!result.Succeeded) { throw new Exception(result.Errors.First().Description); } if (!result.Succeeded) { throw new Exception(result.Errors.First().Description); } Console.WriteLine($"{roleItem?.Name} created");//AspNetUserClaims 表 } } } Console.WriteLine("Done seeding database."); Console.WriteLine(); } private static void EnsureSeedData(ConfigurationDbContext context) { if (!context.Clients.Any()) { Console.WriteLine("Clients being populated"); foreach (var client in Config.GetClients().ToList()) { context.Clients.Add(client.ToEntity()); } context.SaveChanges(); } else { Console.WriteLine("Clients already populated"); } if (!context.IdentityResources.Any()) { Console.WriteLine("IdentityResources being populated"); foreach (var resource in Config.GetIdentityResources().ToList()) { context.IdentityResources.Add(resource.ToEntity()); } context.SaveChanges(); } else { Console.WriteLine("IdentityResources already populated"); } if (!context.ApiResources.Any()) { Console.WriteLine("ApiResources being populated"); foreach (var resource in Config.GetApiResources().ToList()) { context.ApiResources.Add(resource.ToEntity()); } context.SaveChanges(); } else { Console.WriteLine("ApiResources already populated"); } if (!context.ApiScopes.Any()) { Console.WriteLine("ApiScopes being populated"); foreach (var resource in Config.GetApiScopes().ToList()) { context.ApiScopes.Add(resource.ToEntity()); } context.SaveChanges(); } else { Console.WriteLine("ApiScopes already populated"); } } } } ================================================ FILE: Blog.IdentityServer/Startup.cs ================================================ using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Blog.IdentityServer.Data; using Blog.IdentityServer.Models; using System.Reflection; using System.IO; using Microsoft.Extensions.Hosting; using Microsoft.AspNetCore.Http; using Blog.IdentityServer.Extensions; using Microsoft.AspNetCore.Authorization; using Blog.IdentityServer.Authorization; using Microsoft.AspNetCore.HttpOverrides; using IdentityServer4.Extensions; namespace Blog.IdentityServer { public class Startup { public IConfiguration Configuration { get; } public IWebHostEnvironment Environment { get; } public Startup(IConfiguration configuration, IWebHostEnvironment environment) { Configuration = configuration; Environment = environment; } public void ConfigureServices(IServiceCollection services) { services.AddSameSiteCookiePolicy(); string connectionStringFile = Configuration.GetConnectionString("DefaultConnection_file"); var connectionString = File.Exists(connectionStringFile) ? File.ReadAllText(connectionStringFile).Trim() : Configuration.GetConnectionString("DefaultConnection"); var isMysql = Configuration.GetConnectionString("IsMysql").ObjToBool(); if (connectionString == "") { throw new Exception("数据库配置异常"); } var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name; if (isMysql) { // mysql services.AddDbContext(options => options.UseMySql(connectionString)); } else { // sqlserver services.AddDbContext(options => options.UseSqlServer(connectionString)); }; services.Configure( options => { //options.Password.RequireDigit = false; //options.Password.RequireLowercase = false; //options.Password.RequireNonAlphanumeric = false; //options.Password.RequireUppercase = false; //options.SignIn.RequireConfirmedEmail = false; //options.SignIn.RequireConfirmedPhoneNumber = false; //options.User.AllowedUserNameCharacters = null; }); services.AddIdentity(options => { options.User = new UserOptions { RequireUniqueEmail = true, //要求Email唯一 AllowedUserNameCharacters = null //允许的用户名字符 }; options.Password = new PasswordOptions { RequiredLength = 8, //要求密码最小长度,默认是 6 个字符 RequireDigit = true, //要求有数字 RequiredUniqueChars = 3, //要求至少要出现的字母数 RequireLowercase = true, //要求小写字母 RequireNonAlphanumeric = false, //要求特殊字符 RequireUppercase = false //要求大写字母 }; //options.Lockout = new LockoutOptions //{ // AllowedForNewUsers = true, // 新用户锁定账户 // DefaultLockoutTimeSpan = TimeSpan.FromHours(1), //锁定时长,默认是 5 分钟 // MaxFailedAccessAttempts = 3 //登录错误最大尝试次数,默认 5 次 //}; //options.SignIn = new SignInOptions //{ // RequireConfirmedEmail = true, //要求激活邮箱 // RequireConfirmedPhoneNumber = true //要求激活手机号 //}; //options.ClaimsIdentity = new ClaimsIdentityOptions //{ // // 这里都是修改相应的Cliams声明的 // RoleClaimType = "IdentityRole", // UserIdClaimType = "IdentityId", // SecurityStampClaimType = "SecurityStamp", // UserNameClaimType = "IdentityName" //}; }) .AddEntityFrameworkStores() .AddDefaultTokenProviders(); services.ConfigureApplicationCookie(options => { options.LoginPath = new PathString("/oauth2/authorize"); }); //配置session的有效时间,单位秒 services.AddSession(options => { options.IdleTimeout = TimeSpan.FromSeconds(30); }); services.AddMvc(); services.Configure(iis => { iis.AuthenticationDisplayName = "Windows"; iis.AutomaticAuthentication = false; }); //services.Configure(options => //{ // options.ForwardedHeaders = // ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost; // options.KnownNetworks.Clear(); // options.KnownProxies.Clear(); //}); var builder = services.AddIdentityServer(options => { options.Events.RaiseErrorEvents = true; options.Events.RaiseInformationEvents = true; options.Events.RaiseFailureEvents = true; options.Events.RaiseSuccessEvents = true; // 查看发现文档 if (Configuration["StartUp:IsOnline"].ObjToBool()) { options.IssuerUri = Configuration["StartUp:OnlinePath"].ObjToString(); } options.UserInteraction = new IdentityServer4.Configuration.UserInteractionOptions { LoginUrl = "/oauth2/authorize",//登录地址 }; }) // 自定义验证,可以不走Identity //.AddResourceOwnerValidator() .AddExtensionGrantValidator() // 数据库模式 .AddAspNetIdentity() // this adds the config data from DB (clients, resources) .AddConfigurationStore(options => { if (isMysql) { options.ConfigureDbContext = b => b.UseMySql(connectionString, sql => sql.MigrationsAssembly(migrationsAssembly)); } else { options.ConfigureDbContext = b => b.UseSqlServer(connectionString, sql => sql.MigrationsAssembly(migrationsAssembly)); } }) // this adds the operational data from DB (codes, tokens, consents) .AddOperationalStore(options => { if (isMysql) { options.ConfigureDbContext = b => b.UseMySql(connectionString, sql => sql.MigrationsAssembly(migrationsAssembly)); } else { options.ConfigureDbContext = b => b.UseSqlServer(connectionString, sql => sql.MigrationsAssembly(migrationsAssembly)); } // this enables automatic token cleanup. this is optional. options.EnableTokenCleanup = true; // options.TokenCleanupInterval = 15; // frequency in seconds to cleanup stale grants. 15 is useful during debugging }); builder.AddDeveloperSigningCredential(); if (Environment.IsDevelopment()) { builder.AddDeveloperSigningCredential(); } services.AddAuthorization(options => { options.AddPolicy("Admin", policy => policy.Requirements.Add(new ClaimRequirement("rolename", "Admin"))); options.AddPolicy("SuperAdmin", policy => policy.Requirements.Add(new ClaimRequirement("rolename", "SuperAdmin"))); }); services.AddSingleton(); services.AddIpPolicyRateLimitSetup(Configuration); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.Use(async (ctx, next) => { if (Configuration["StartUp:IsOnline"].ObjToBool()) { ctx.SetIdentityServerOrigin(Configuration["StartUp:OnlinePath"].ObjToString()); } await next(); }); app.UseIpLimitMildd(); //app.UseForwardedHeaders(); app.UseCookiePolicy(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); //app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseSession(); app.UseStaticFiles(); app.UseRouting(); app.UseIdentityServer(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); } } } ================================================ FILE: Blog.IdentityServer/Views/Account/AccessDenied.cshtml ================================================ @{ ViewData["Title"] = "Access denied"; }

@ViewData["Title"]

You do not have access to this resource.

@Html.Raw(ViewBag.ErrorMsg)

================================================ FILE: Blog.IdentityServer/Views/Account/ConfirmEmail.cshtml ================================================ @{ ViewData["Title"] = "Confirm email"; }

@ViewData["Title"]

Thank you for confirming your email.

================================================ FILE: Blog.IdentityServer/Views/Account/Edit.cshtml ================================================ @model EditViewModel @{ ViewData["Title"] = "Edit"; }

@ViewData["Title"]

@{ foreach (var item in Model.Claims) {

@item

} }

Create a new account.


================================================ FILE: Blog.IdentityServer/Views/Account/ForgotPassword.cshtml ================================================ @model ForgotPasswordViewModel @{ ViewData["Title"] = "Forgot your password?"; }

@ViewData["Title"]

Enter your email.


请填写注册时自定义的答案,两个都需要填写
如果注册时未填写,暂不支持找回密码,请留空并点击Submit,在下一页的link中,提交人工处理找回密码。
================================================ FILE: Blog.IdentityServer/Views/Account/ForgotPasswordConfirmation.cshtml ================================================ @{ ViewData["Title"] = "Forgot password confirmation"; }

@ViewData["Title"]

@Html.Raw(ViewBag.ResetPassword)

================================================ FILE: Blog.IdentityServer/Views/Account/LoggedOut.cshtml ================================================ @model LoggedOutViewModel @{ // set this so the layout rendering sees an anonymous user ViewData["signed-out"] = true; } @section scripts { @if (Model.AutomaticRedirectAfterSignOut) { } } ================================================ FILE: Blog.IdentityServer/Views/Account/Login.cshtml ================================================ @model LoginViewModel

BlogIdp

@if (Model.EnableLocalLogin) { } @if (Model.VisibleExternalProviders.Any()) {

External Login

} @if (!Model.EnableLocalLogin && !Model.VisibleExternalProviders.Any()) {
Invalid login request There are no login schemes configured for this client.
}
================================================ FILE: Blog.IdentityServer/Views/Account/Logout.cshtml ================================================ @model LogoutViewModel

Would you like to logout of IdentityServer?

================================================ FILE: Blog.IdentityServer/Views/Account/My.cshtml ================================================ @model EditViewModel @{ ViewData["Title"] = "个人中心"; }

@ViewData["Title"]

Create a new account.


================================================ FILE: Blog.IdentityServer/Views/Account/Register.cshtml ================================================ @model RegisterViewModel @{ ViewData["Title"] = "Register"; }

@ViewData["Title"]

Create a new account.


支持登录名和邮箱两种方式登录。
请务必认真填写密保答案,此为后期找回账户名和密码的唯一依据,不再提供人工找回密码!请牢记自己的内容。
密保问题两个必须都填写。
================================================ FILE: Blog.IdentityServer/Views/Account/ResetPassword.cshtml ================================================ @model ResetPasswordViewModel @{ ViewData["Title"] = "Reset password"; }

@ViewData["Title"]

Reset your password.


================================================ FILE: Blog.IdentityServer/Views/Account/ResetPasswordConfirmation.cshtml ================================================ @{ ViewData["Title"] = "Reset password confirmation"; }

@ViewData["Title"]

Your password has been reset. Please click here to log in.

================================================ FILE: Blog.IdentityServer/Views/Account/RoleEdit.cshtml ================================================ @model RoleEditViewModel @{ ViewData["Title"] = "Edit"; }

@ViewData["Title"]

Create a new account.


================================================ FILE: Blog.IdentityServer/Views/Account/RoleRegister.cshtml ================================================ @model RoleRegisterViewModel @{ ViewData["Title"] = "Register"; }

@ViewData["Title"]

Create a new account.


================================================ FILE: Blog.IdentityServer/Views/Account/Roles.cshtml ================================================ @model List @{ ViewData["Title"] = "Roles"; }

@ViewData["Title"]



@foreach (var item in Model) { }
Name Operate
@Html.DisplayFor(modelItem => item.Name) Edit
================================================ FILE: Blog.IdentityServer/Views/Account/Users.cshtml ================================================ @model List @{ ViewData["Title"] = "Users"; int index = 0; }

@ViewData["Title"]



@foreach (var item in Model) { index++; }
# Id UserName LoginName CreateTime AccessFailedCount Operate
@(Model.Count-index) @Html.DisplayFor(modelItem => item.Id) @Html.DisplayFor(modelItem => item.LoginName) @Html.DisplayFor(modelItem => item.UserName) @Html.DisplayFor(modelItem => item.birth) @Html.DisplayFor(modelItem => item.AccessFailedCount) Edit
================================================ FILE: Blog.IdentityServer/Views/ApiResourcesManager/CreateOrEdit.cshtml ================================================  @{ ViewData["Title"] = "Create"; }

{{ title }}

Api资源名称:
显示名称:
描述:
允许的声明:
作用域:
================================================ FILE: Blog.IdentityServer/Views/ApiResourcesManager/Index.cshtml ================================================ @model List @using IdentityServer4.EntityFramework.Mappers @{ ViewData["Title"] = "APIs"; }

@ViewData["Title"]



@foreach (var item in Model) { var apiResourceModel = item.ToModel(); }
资源名称 显示名称 声明 作用域 描述 Operate
@Html.DisplayFor(modelItem => item.Name) @Html.DisplayFor(modelItem => item.DisplayName) @Html.Raw(string.Join("
", apiResourceModel.UserClaims))
@Html.Raw(string.Join("
", apiResourceModel.Scopes))
@Html.DisplayFor(modelItem => item.Description) Edit
================================================ FILE: Blog.IdentityServer/Views/ClientsManager/CreateOrEdit.cshtml ================================================  @{ ViewData["Title"] = "Create"; }

{{ title }}

客户端Id:
客户端名称:
客户端密钥:
描述:
允许的授权类型:
允许将token通过浏览器传递:
@**@
作用域:
允许的跨域域名:
回调地址:
退出的回调:
================================================ FILE: Blog.IdentityServer/Views/ClientsManager/Index.cshtml ================================================ @model List @using IdentityServer4.EntityFramework.Mappers @{ ViewData["Title"] = "Clients"; }

@ViewData["Title"]


Add New

如果你需要一个客户端,用来学习三端联调,但是又不想自己搭认证中心,可以使用本平台,请联系老张的哲学。


@foreach (var item in Model) { var clientModel = item.ToModel(); }
客户端Id 客户端名 授权类型 作用域 允许跨域 回调地址 退出回调 Operate
@(!string.IsNullOrEmpty(item.ClientId) && item.ClientId.Contains("xyz000!") ? "VIP用户专属" : item.ClientId) @Html.DisplayFor(modelItem => item.ClientName) @Html.Raw(string.Join("
", clientModel.AllowedGrantTypes))
@Html.Raw(string.Join("
", clientModel.AllowedScopes))
@Html.Raw(string.Join("
", clientModel.AllowedCorsOrigins))
@Html.Raw(string.Join("
", clientModel.RedirectUris))
@Html.Raw(string.Join("
", clientModel.PostLogoutRedirectUris))
Edit
================================================ FILE: Blog.IdentityServer/Views/Consent/Index.cshtml ================================================ @model ConsentViewModel ================================================ FILE: Blog.IdentityServer/Views/Device/Success.cshtml ================================================

Success

You have successfully authorized the device

================================================ FILE: Blog.IdentityServer/Views/Device/UserCodeCapture.cshtml ================================================ @model string

User Code

Please enter the code displayed on your device.

================================================ FILE: Blog.IdentityServer/Views/Device/UserCodeConfirmation.cshtml ================================================ @model DeviceAuthorizationViewModel
@if (Model.ClientLogoUrl != null) { }

@Model.ClientName is requesting your permission

@if (Model.ConfirmUserCode) {

Please confirm that the authorization request quotes the code: @Model.UserCode.

}

Uncheck the permissions you do not wish to grant.

@if (Model.IdentityScopes.Any()) {
Personal Information
    @foreach (var scope in Model.IdentityScopes) { }
} @if (Model.ApiScopes.Any()) {
Application Access
    @foreach (var scope in Model.ApiScopes) { }
}
Description
@if (Model.AllowRememberConsent) {
}
@if (Model.ClientUrl != null) { @Model.ClientName }
================================================ FILE: Blog.IdentityServer/Views/Diagnostics/Index.cshtml ================================================ @model DiagnosticsViewModel

Authentication cookie

Claims

@foreach (var claim in Model.AuthenticateResult.Principal.Claims) {
@claim.Type
@claim.Value
}

Properties

@foreach (var prop in Model.AuthenticateResult.Properties.Items) {
@prop.Key
@prop.Value
}
@if (Model.Clients.Any()) {

Clients

    @foreach (var client in Model.Clients) {
  • @client
  • }
} ================================================ FILE: Blog.IdentityServer/Views/Grants/Config.cshtml ================================================  @{ ViewData["Title"] = "Config"; }

All Grants Type Config

Below is the list of configs,you can configure it according to the type of authorization you need.

1、client_credentials

适用于和用户无关,机器与机器之间直接交互访问资源的场景。
这种模式一般只用在服务端与服务端之间的认证,在c#中请求令牌,认证服务器不提供像用户数据这样的重要资源,仅仅是有限的只读资源或者一些开放的API。
Ids4:
                 // 控制台客户端 客户端凭证模式
                new Client
                {
                    ClientId = "credentials_client",
                    ClientName = "Client Credentials Client",

                    AllowedGrantTypes = GrantTypes.ClientCredentials,
                    ClientSecrets = { new Secret("secret".Sha256()) },

                    AllowedScopes = { "blog.core.api" }
                },
            
Client Console:
                 using var client = new HttpClient();
                 var discoResponse = await client.GetDiscoveryDocumentAsync("http://localhost:5004");
                 if (discoResponse.IsError)
                 {
                     Console.WriteLine(discoResponse.Error);
                     return;
                 }

                 var tokenResponse = await client.RequestClientCredentialsTokenAsync(new ClientCredentialsTokenRequest
                 {
                     Address = discoResponse.TokenEndpoint,
                     ClientId = "Console",// 客户端id
                     Scope = "blog.core.api",// 对应的受保护资源服务器id
                     ClientSecret = "secret",
                 });

                 if (tokenResponse.IsError)
                 {
                     Console.WriteLine(tokenResponse.Error);
                     return;
                 }

                 Console.WriteLine(tokenResponse.Json);
                 client.SetBearerToken(tokenResponse.AccessToken);
                 // 获取access_token后,向资源服务器发起请求
                 var response = await client.GetAsync("http://localhost:8081/api/blog/1");
     
            

2、password

这种模式适用于鉴权服务器与资源服务器是高度相互信任的,例如两个服务都是同个团队或者同一公司开发的。该应用Client就使用你的密码,申请令牌,这种方式称为"密码式"(password)。
如果你对接的是第三方的客户端,请不要使用这个方案,因为第三方可能会记录你的认证平台的用户安全信息比如用户名和密码)
这种模式比客户端凭证模式的好处是多了用户信息,同时也可以自定义Claim声明。
Ids4:
            
               // 自定义claim
                public static IEnumerable ApiScopes =>
                new ApiScope[]
                {
                    new ApiScope("password_scope1")
                };
                
                public static IEnumerable ApiResources =>
                 new ApiResource[]
                 {

                     new ApiResource("blog.core.api","api1")
                     {
                         Scopes={ "blog.core.api" },
                         UserClaims={JwtClaimTypes.Role},  //添加Cliam 角色类型,同时,用户的claim也许配置!
                         ApiSecrets={new Secret("apisecret".Sha256())}
                     }
                 };
                
                        
                 // 控制台客户端 密码模式
                 new Client
                 {
                     ClientId = "password_client",
                     ClientSecrets = { new Secret("secret".Sha256()) },

                     AllowedGrantTypes = new List()
                     {
                         GrantTypes.ResourceOwnerPassword.FirstOrDefault(),
                     },

                     AllowedScopes = new List
                     {
                         "blog.core.api"
                     }
                 }
            
Client Console:
                 using var client = new HttpClient();
                 var discoResponse = await client.GetDiscoveryDocumentAsync("http://localhost:5004");
                 if (discoResponse.IsError)
                 {
                     Console.WriteLine(discoResponse.Error);
                     return;
                 }

                 var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest
                 {
                     Address = discoResponse.TokenEndpoint,
                     ClientId = "password_client",// 客户端id
                     Scope = "blog.core.api",// 对应的受保护资源服务器id
                     ClientSecret = "secret",
                     UserName = "laozhang",// 这里的用户名密码,是我SeedData的时候导入的
                     Password = "BlogIdp123$InitPwd"
                 });

                 if (tokenResponse.IsError)
                 {
                     Console.WriteLine(tokenResponse.Error);
                     return;
                 }

                 Console.WriteLine(tokenResponse.Json);
                 client.SetBearerToken(tokenResponse.AccessToken);
                 // 获取access_token后,向资源服务器发起请求
                 var response = await client.GetAsync("http://localhost:8081/api/blog/1");
     
            

3、implicit(MVC模式)

让用户自己在IdentityServer服务器进行登录验证,客户端不需要知道用户的密码,从而实现用户密码的安全性。
有些 Web 应用是纯前端应用,没有后端,必须将令牌储存在前端。这种方式没有授权码这个中间步骤,所以称为(授权码)"简化"(implicit)。
简化模式(implicit grant type)不通过第三方应用程序的服务器,直接在浏览器中向认证服务器申请令牌,跳过了"授权码"这个步骤
这种模式基于安全性考虑,建议把token时效设置短一些, 不支持refresh token
这种模式由于token携带在url中,安全性方面不能保证。不过,令牌的位置是 URL 锚点(fragment),而不是查询字符串(querystring),这是因为 OAuth 2.0 允许跳转网址是 HTTP 协议,因此存在"中间人攻击"的风险,而浏览器跳转时,锚点不会发到服务器,就减少了泄漏令牌的风险。
Ids4:
                new Client
                {
                    ClientId = "Implicit_client",
                    ClientName="Demo MVC Client",

                    AllowedGrantTypes = GrantTypes.Implicit,
                 
                    RedirectUris = { "http://localhost:1003/signin-oidc" },
                    PostLogoutRedirectUris = { "http://localhost:1003/signout-callback-oidc" },
                    
                    RequireConsent=true,

                    AllowedScopes = new List
                    {
                        IdentityServerConstants.StandardScopes.OpenId,
                        IdentityServerConstants.StandardScopes.Profile,
                        IdentityServerConstants.StandardScopes.Email,
                        "roles",
                        "rolename",
                        "blog.core.api"
                    }
                }
            
Client MVC:

            services.AddAuthentication(options =>
            {
                options.DefaultScheme = "Cookies";
                options.DefaultChallengeScheme = "oidc";
            })
               .AddCookie("Cookies")
              .AddOpenIdConnect("oidc", options =>
              {
                  options.Authority = "http://localhost:5004";
                  options.RequireHttpsMetadata = false;
                  options.ClientId = "Implicit_client";
                  options.SaveTokens = true;
                  options.GetClaimsFromUserInfoEndpoint = true;
              });
            

4、implicit(VUE模式)

Ids4:
                new Client {
                    ClientId = "blogvuejs",
                    ClientName = "Blog.Vue JavaScript Client",
                    AllowedGrantTypes = GrantTypes.Implicit,
                    AllowAccessTokensViaBrowser = true,

                    RedirectUris =           {
                        "http://vueblog.neters.club/callback",
                        "http://apk.neters.club/oauth2-redirect.html",
                        "http://localhost:6688/callback",
                        "http://localhost:8081/oauth2-redirect.html",
                    },
                    PostLogoutRedirectUris = { "http://vueblog.neters.club","http://localhost:6688" },
                    AllowedCorsOrigins =     { "http://vueblog.neters.club","http://localhost:6688" },

                    AccessTokenLifetime=3600,

                    AllowedScopes = {
                        IdentityServerConstants.StandardScopes.OpenId,
                        IdentityServerConstants.StandardScopes.Profile,
                        "roles",
                        "blog.core.api.BlogModule"
                    }
                },
            
Client Vue.js:
                 
            import { UserManager } from 'oidc-client'

            class ApplicationUserManager extends UserManager {
              constructor () {
                super({
                  authority: 'https://ids.neters.club',
                  client_id: 'blogadminjs',
                  redirect_uri: 'http://vueadmin.neters.club/callback',
                  response_type: 'id_token token',
                  scope: 'openid profile roles blog.core.api',
                  post_logout_redirect_uri: 'http://vueadmin.neters.club'
                })
              }

              async login () {
                await this.signinRedirect()
                return this.getUser()
              }

              async logout () {
                return this.signoutRedirect()
              }
            }

            

5、authorization_code

这种模式不同于简化模式,在于授权码模式不直接返回token,而是先返回一个授权码,然后再根据这个授权码去请求token。这显得更为安全。
通过多种授权模式中的授权码模式进行说明,主要针对介绍IdentityServer保护API的资源,授权码访问API资源。
Ids4:
                new Client
                {
                    ClientId = "blazorserver",
                    ClientSecrets = { new Secret("secret".Sha256()) },

                    AllowedGrantTypes = GrantTypes.Code,
                    RequireConsent = false,
                    RequirePkce = true,
                    AlwaysIncludeUserClaimsInIdToken=true,//将用户所有的claims包含在IdToken内
                    AllowAccessTokensViaBrowser = true,
                
                    // where to redirect to after login
                    RedirectUris = { "https://mvp.neters.club/signin-oidc" },

                    AllowedCorsOrigins =     { "https://mvp.neters.club" },
                   
                    // where to redirect to after logout
                    PostLogoutRedirectUris = { "https://mvp.neters.club/signout-callback-oidc" },

                    AllowedScopes = new List
                    {
                        IdentityServerConstants.StandardScopes.OpenId,
                        IdentityServerConstants.StandardScopes.Profile,
                        IdentityServerConstants.StandardScopes.Email,
                        "roles",
                        "rolename",
                        "blog.core.api"
                    }
                },
            
Client MVC:
                 
            // 第一部分:认证方案的配置
            // add cookie-based session management with OpenID Connect authentication
            services.AddAuthentication(options =>
            {
                options.DefaultScheme = "Cookies";
                options.DefaultChallengeScheme = "oidc";
            })
            .AddCookie("Cookies", options =>
            {
                //options.Cookie.Name = "blazorclient";

                //options.ExpireTimeSpan = TimeSpan.FromHours(1);
                //options.SlidingExpiration = false;
            })
            .AddOpenIdConnect("oidc", options =>
            {
                options.Authority = "https://ids.neters.club/";
                options.RequireHttpsMetadata = false;//必须https协议
                options.ClientId = "blazorserver"; // 75 seconds
                options.ClientSecret = "secret";
                options.ResponseType = "code";
                options.SaveTokens = true;

                // 为api在使用refresh_token的时候,配置offline_access作用域
                options.GetClaimsFromUserInfoEndpoint = true;
                // 作用域获取
                options.Scope.Clear();
                options.Scope.Add("roles");//"roles"
                options.Scope.Add("rolename");//"rolename"
                options.Scope.Add("blog.core.api");
                options.Scope.Add("profile");
                options.Scope.Add("openid");

                options.Events = new OpenIdConnectEvents
                {
                    // called if user clicks Cancel during login
                    OnAccessDenied = context =>
                    {
                        context.HandleResponse();
                        context.Response.Redirect("/");
                        return Task.CompletedTask;
                    }
                };
            });

            

6、hybrid

客户端根据ResponseType的不同,authorization endpoint返回可以分为三种情况:"code id_token"、"code token"、"code id_token token"
适用于服务器端 Web 应用程序和原生桌面/移动应用程序,混合模式是简化模式和授权码模式的组合。
每当考虑使用授权码模式的时候,一般都是使用混合模式。
Ids4:
                new Client
                {
                    ClientId = "hybridclent",
                    ClientName="Demo MVC Client",
                    ClientSecrets = { new Secret("secret".Sha256()) },

                    AllowedGrantTypes = GrantTypes.Hybrid,
                    
                    AllowAccessTokensViaBrowser = true,//返回类型包含token时候,配置
                 
                    RequirePkce = false,//v4.x需要配置这个

                    RedirectUris = { "http://localhost:1003/signin-oidc" },
                    PostLogoutRedirectUris = { "http://localhost:1003/signout-callback-oidc" },

                    AllowOfflineAccess=true,
                    AlwaysIncludeUserClaimsInIdToken=true,

                    AllowedScopes = new List
                    {
                        IdentityServerConstants.StandardScopes.OpenId,
                        IdentityServerConstants.StandardScopes.Profile,
                        IdentityServerConstants.StandardScopes.Email,
                        "roles",
                        "rolename",
                        "blog.core.api"
                    }
                }
            
Client MVC:

            JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();

            // 认证方案的配置
            services.AddAuthentication(options =>
            {
                options.DefaultScheme = "Cookies";
                options.DefaultChallengeScheme = "oidc";
            })
            .AddCookie("Cookies", options =>
            {
                options.AccessDeniedPath = "/Authorization/NoPermission";
            })
            .AddOpenIdConnect("oidc", options =>
            {
                options.SignInScheme = "Cookies";

                options.Authority = "https://ids.neters.club";
                options.RequireHttpsMetadata = false;
                options.ClientId = "hybridclent";
                options.ClientSecret = "secret";

                options.ResponseType = "code id_token";

                options.GetClaimsFromUserInfoEndpoint = true;
                options.SaveTokens = true;


                // 为api在使用refresh_token的时候,配置offline_access作用域
                //options.GetClaimsFromUserInfoEndpoint = true;

                // 作用域获取
                options.Scope.Clear();
                options.Scope.Add("roles");
                options.Scope.Add("rolename");
                options.Scope.Add("blog.core.api");
                options.Scope.Add("profile");
                options.Scope.Add("openid");

                //options.ClaimActions.MapJsonKey("website", "website");

                options.TokenValidationParameters = new TokenValidationParameters
                {
                    //映射 User.Name
                    //NameClaimType = JwtClaimTypes.Name,
                    //RoleClaimType = JwtClaimTypes.Role
                };
            });
            
================================================ FILE: Blog.IdentityServer/Views/Grants/Index.cshtml ================================================ @model GrantsViewModel

Client Application Permissions

Below is the list of applications you have given permission to and the resources they have access to.

@if (Model.Grants.Any() == false) {
You have not given access to any applications
} else { foreach (var grant in Model.Grants) {
@if (grant.ClientLogoUrl != null) { } @grant.ClientName
    @if (grant.Description != null) {
  • @grant.Description
  • }
  • @grant.Created.ToString("yyyy-MM-dd")
  • @if (grant.Expires.HasValue) {
  • @grant.Expires.Value.ToString("yyyy-MM-dd")
  • } @if (grant.IdentityGrantNames.Any()) {
    • @foreach (var name in grant.IdentityGrantNames) {
    • @name
    • }
  • } @if (grant.ApiGrantNames.Any()) {
    • @foreach (var name in grant.ApiGrantNames) {
    • @name
    • }
  • }
} }
================================================ FILE: Blog.IdentityServer/Views/Home/Index.cshtml ================================================ @using IdentityServer4.Extensions @{ string name = null; if (!true.Equals(ViewData["signed-out"])) { name = Context.User?.GetDisplayName(); } }

Logo

欢迎来到 Blog.IdentityServer

@if (!string.IsNullOrWhiteSpace(name)) {

持久授权

} else {

登录

}

发现文档

各模式配置

================================================ FILE: Blog.IdentityServer/Views/Shared/Error.cshtml ================================================ @model ErrorViewModel @{ var error = Model?.Error?.Error; var errorDescription = Model?.Error?.ErrorDescription; var request_id = Model?.Error?.RequestId; }
Sorry, there was an error @if (error != null) { : @error if (errorDescription != null) {
@errorDescription
} }
@if (request_id != null) {
Request Id: @request_id
}
================================================ FILE: Blog.IdentityServer/Views/Shared/Redirect.cshtml ================================================ @model RedirectViewModel

You are now being returned to the application.

Once complete, you may close this tab

================================================ FILE: Blog.IdentityServer/Views/Shared/_Layout.cshtml ================================================ @using IdentityServer4.Extensions @{ string name = null; if (!true.Equals(ViewData["signed-out"])) { name = Context.User?.GetDisplayName(); } } IdentityServer4 @* *@ @**@ @if (!string.IsNullOrWhiteSpace(name)) { }
@RenderBody()
@RenderSection("scripts", required: false) ================================================ FILE: Blog.IdentityServer/Views/Shared/_ScopeListItem.cshtml ================================================ @model ScopeViewModel
  • @if (Model.Required) { (required) } @if (Model.Description != null) { }
  • ================================================ FILE: Blog.IdentityServer/Views/Shared/_ValidationSummary.cshtml ================================================ @if (ViewContext.ModelState.IsValid == false) {
    Error
    } ================================================ FILE: Blog.IdentityServer/Views/_ViewImports.cshtml ================================================ @using IdentityServer4.Quickstart.UI @using IdentityServer4.Quickstart.UI.Device @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers ================================================ FILE: Blog.IdentityServer/Views/_ViewStart.cshtml ================================================ @{ Layout = "_Layout"; } ================================================ FILE: Blog.IdentityServer/appsettings.Development.json ================================================ { "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Debug", "System": "Information", "Microsoft": "Information" } } } ================================================ FILE: Blog.IdentityServer/appsettings.json ================================================ { "Logging": { "IncludeScopes": false, "Debug": { "LogLevel": { "Default": "Warning" } }, "Console": { "LogLevel": { "Default": "Warning", "Microsoft.Hosting.Lifetime": "Debug" } } }, "ConnectionStrings": { "IsMysql": true,//默认开启mysql "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=BlogIdpPro;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", "DefaultConnection_file": "c:\\my-file\\dbCountPsw1_ldpxx.txt" }, "Certificates": { "Path": "Certificates\\IS4.pfx", "Password": "anson7" }, "StartUp": { "IsOnline": false, "OnlinePath": "https://ids.neters.club" }, "IpRateLimiting": { "EnableEndpointRateLimiting": true, //False: globally executed, true: executed for each "StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter "RealIpHeader": "X-Real-IP", "ClientIdHeader": "X-ClientId", "IpWhitelist": [], //白名单 "EndpointWhitelist": [ "get:/api/xxx", "*:/api/yyy" ], "ClientWhitelist": [ "dev-client-1", "dev-client-2" ], "QuotaExceededResponse": { "Content": "{{\"status\":429,\"msg\":\"访问过于频繁,请一分钟后重试\",\"success\":false}}", "ContentType": "application/json", "StatusCode": 429 }, "HttpStatusCode": 429, //返回状态码 "GeneralRules": [ //api规则,结尾一定要带* { "Endpoint": "*:/account/register*", "Period": "1m", "Limit": 8 }, { "Endpoint": "*:/oauth2/authorize*", "Period": "1m", "Limit": 10 }, { "Endpoint": "*/api/*", "Period": "1s", "Limit": 1 } ] } } ================================================ FILE: Blog.IdentityServer/tempkey.jwk ================================================ {"alg":"RS256","d":"HwqpgH1B1efVFfOh8siXQln2Hc3a5jwNv8iO34ApQ2kIMpirKhvuYbgZfIlroPDEPObOLCXgZWbrQgRi-OkoAPgPbn9vkemT0_au9ZVw6aocDR9rt6AguTrSE68cBz5Qx2oarJ8_TAAqNtByAQOUdll2S0OuBRR2hBfdQKI-eemtoMGi95PV27AeJ4U-35iGvrIC665_ypvbRRymjXOup3hWv0Zh1o5gta9isO2mhBG4K1khGqF_XaYDYQ7t1C02Fj9WrEyGdKta9MgtAnagauD51eQsw2m7yknbfAZEd6a2Ck_knLLTzpyDqkF53qXpi53Z689tuBsTyHML_px3cQ","dp":"mzRXEgwfQ0usqs6UJFKKZPdckFdxsWq38iMrpauELgRON2RZlDEa2Ie_BejGC98TwgOnxP3Lh794BFxS11g0-JDQAyhdTvvj-XGJixeeWTdc-azdDumVS3lh-GTv0KoCJ9IuRytrAbjkeIezQ1z5z2sMq0YZlpiWwErsM_jdUo8","dq":"UyQcmL9XkA3Wt3uLQLb4ZMCgTIYk92wfwudU1XvKsBaJubRkdlph9-he4stqWU6sNoFChcrmtWW4fTlARiIbBDYPCKGrCxq0DwXNe3NzF4R7T8s5Ft_hxxGTfWJQ6Ba9G1KaRyKnw98Hu7RqYWyYrm-RyfqEYNu_nA7QxtvBokk","e":"AQAB","kid":"039695D7F0DC6503E128F4FAAB3585B9","kty":"RSA","n":"sSYWLw2EIKwo97ky4R2PW5ouXKT5wqEgGMA3G1pX_7HKlJKKoNaMTB1_KsarQRnihdGzj2HrB5BggAlieEo1MPRT9rOKVDMhvVvRjLcd2edWvi6-FXxlgL9tYA9UlVGWu1Dr6K5SG0X066PRqlhl31GDcvsf2Yjzy-PaYeUNM0gDBfwX6Sg-NViNUQaw4xjuOM65lFnoijEdDEl8MuCJdXB_XICUeXKpfdJbbEW2ytW6jmUkKS4oOHteViFeIsp-TFZY2K8aRlasNiI8rKOdwiFIV-h92TocZ3-KD0nlCmJzXDMnRl8mYqfmq6BCELUdutxTGlNgO-d8_4mip4JsiQ","p":"xNqUonYhPcV88q8I2R25ooTLyKtGSuw-WceZCAv6oxKBhFw3bsoL6Juvgjxk6jYH9lN4lsLM88rT9ZPcXbuj8116W_dDQMj3T8TMriTRiV6vV5kt9gjtzDg_8NBxiyJaYz0fiqXlEEFFQUkIOYMa1ITwAPcIJMC2w1x3g9jyHCM","q":"5l_Z3e02rKFNQGc-WMcUbpXETzZDmX2WnF6jiCrzLvzb8DhvpIy13IYc9HcdiN1hgwZgGnfjQXdA1_izDyKw-CzjXkJ0FKucLoSz8fuRdUeu028leO6PNOYYJaR1AfHE4dIU-StplEU5OLeiX8GXm0zDcqWgcUJ2Rz7fX8XneWM","qi":"rw8bjm_5cp7-ezVUE01Lobi_1h1U8xzMJ8QDt3FycdH8mitCf0pTjChfI_FGzcbWXOjq5jFsHv7DyazkURtKD7n3dsKGiq95-ktNpGMwQFIDyVQD2cuKn0tj6Hgss0YfZA_VnG4Fp5a6u1gfLf0mrnPYQf9OUo4mmUO0ONUYRoY"} ================================================ FILE: Blog.IdentityServer/tempkey.rsa ================================================ {"KeyId":"rNruJfc3LCx8qbpod8foCA","Parameters":{"D":"V+uOk1wEljBVqO+h+GfgR214tedtVf7rkLArWvAKTdQkBpTxn9xlEqFsCv//FZoVIXyXK3vXgPt/pXZJ6A42muod2cEYblgNSi/noiKLaQGA/PCA29TM5qqKdfU3pey0qKZr6elPzRuDc2MkbGsLkfXahqK9f4QrDHBZETXjx/7H7N6e0N2T3wJ77EAPYAYRr2IYXOuzfhreU9RzHRfQOketB7kIvacBIaiiheQtPBS60aZm5DruC3LTMpWISNNOCKevFWoS6lQixpCfg/K/Y8QDNnxhafasNpY6ZRNUxnqi8BJ5Dlqo68otOo+JSnURO4x/GhNb1MTMRoay7c2D3Q==","DP":"1SnnkdSmvtG9vE+rsCB54uQTuQpNJvopvVNuB+JUFjGiRHHoe8eMh9AEqDI0BsMoTFGz7bePTapFUOFpRTAQfgZPrTFhvuPCOOONK2ceaUC23yYqa3jdWuwIVDzpanifvz5iTHF1PA65NxXfsF2cOK55G+2833jEHP3TF88dQDk=","DQ":"PriWuA/zvGvRyjWCCwDtNXhXiMyauCQscvy28eZVqB4tyfmN2BynOrWP9+YTmM54cwFvJ4TJBjcOx0AL/mzQGiK40+kcAGSh00AZ/rP8JWUlA1IKGSXuCcArYt/F3CAWwZqNw1EzMGvJ2in6uYPlq1HQDoL9Dp0v7uCS5fXLBrs=","Exponent":"AQAB","InverseQ":"8h9ojX//gM7Y1jbWrF+xOFJfsJDE27A9lpDwC0Vb21CosX1Q0F28iihyLapehKCuoh8+ho8EQhgEQIH+tYiZ1eUCisR3Jn6ZDR6+OQsgJB5hTSskhV7sND0M4yp9+zpEiIwSgG4ES4YVrjbgoxCEfIw1sSW3ZcXHkd3L0wHArOs=","Modulus":"7NtqboAxsXFdo5kc4wccRMxyp7i6cg3YEg4facNgvTwDRRMUtTCuFkXBZBD8R/MQZrmzaYx29sK1XlHNJ7SjoMA0kq77sKjU7kKBWkf5eIhnHKDmIHNCPQzcXOVsr53IIreYXsO66JQW7d/m6Glmr7DT8bOflp3FZEUh/v/1M7F7rcwoTvur1ry/viWPsLx5lekYClfYID1jtjmrC5Xt76CY9ZvcNZ981v8qPkVGhNaEyZBi7Pgm7zUt4iRSQSma5Bc/en+8/C0MxE67kwxxnD3HoCAM9GxlTtbG8XxtlHl3XuSO4sFVW4XTAAdUGcbb3BuUWecNdlKcFO8AmxGJoQ==","P":"8sods2xmYT3BdIA9gM96eK+AR+NpPDzLn4gIPJSLtBIeYzcZ/Xka9WVVlVwCCHeogs/Tk+uy7fq1v/+wcblx8Pl+fncfskpJaaWWCTzRbb75CoEjFXWMYFr9PiZ3FxdFCASQDlMv/FDj0ZVJr8w7rmXo4B8lqZIR//kYbH8EW28=","Q":"+b6qUwFpidC4QDH2dTqASz4HU/ok77Ks+e/CwjmC1H5TlqjRcTlONcwfgO0YIz73PC0D40FxewQrFryn5SK1by0DGuQ8L3rk21araldNFy3/ui4Hu7AqTSZrhitoEaMgXNhv1G7oDoreWzxowzW5xyiJ/5SsDMn9ezWkPaqAI+8="}} ================================================ FILE: Blog.IdentityServer/wwwroot/css/login_styles.css ================================================ * { box-sizing: border-box; margin: 0; padding: 0; font-weight: 300; } body { font-family: 'Source Sans Pro', sans-serif; color: white; font-weight: 300; margin: 0; } body ::-webkit-input-placeholder { /* WebKit browsers */ font-family: 'Source Sans Pro', sans-serif; color: white; font-weight: 300; } body :-moz-placeholder { /* Mozilla Firefox 4 to 18 */ font-family: 'Source Sans Pro', sans-serif; color: white; opacity: 1; font-weight: 300; } body ::-moz-placeholder { /* Mozilla Firefox 19+ */ font-family: 'Source Sans Pro', sans-serif; color: white; opacity: 1; font-weight: 300; } body :-ms-input-placeholder { /* Internet Explorer 10+ */ font-family: 'Source Sans Pro', sans-serif; color: white; font-weight: 300; } .wrapper { background: #50a3a2; /*background: -webkit-linear-gradient(top left, #50a3a2 0%, #53e3a6 100%);*/ background: linear-gradient(to bottom right,#127c7b 0,#50a3a2); opacity: 0.8; position: absolute; left: 0; width: 100%; height: 100%; overflow: hidden; } .wrapper.form-success .containerLogin h1 { -webkit-transform: translateY(85px); -ms-transform: translateY(85px); transform: translateY(85px); } .containerLogin { max-width: 600px; margin: 0 auto; padding: 80px 0; height: 400px; text-align: center; } .containerLogin h1 { font-size: 40px; -webkit-transition-duration: 1s; transition-duration: 1s; -webkit-transition-timing-function: ease-in-put; transition-timing-function: ease-in-put; font-weight: 200; } form { padding: 20px 0; position: relative; z-index: 2; } .login-container { border-radius: 5px; background-clip: padding-box; margin: auto; padding: 35px 35px 15px 35px; border: 1px solid #eaeaea; -webkit-box-shadow: 0 0 25px #cac6c6; box-shadow: 0 0 25px #cac6c6; } form input.login-name, form input.login-pass { -webkit-appearance: none; -moz-appearance: none; appearance: none; outline: 0; border: 1px solid rgba(255, 255, 255, 0.4); background-color: rgba(255, 255, 255, 0.2); width: 250px; max-width: 250px; border-radius: 3px; padding: 10px 15px; margin: 0 auto 10px auto; display: block; text-align: center; font-size: 18px; color: white; -webkit-transition-duration: 0.25s; transition-duration: 0.25s; font-weight: 300; } form input.login-name:hover, form input.login-pass:hover { background-color: rgba(255, 255, 255, 0.4); } form input.login-name:focus, form input.login-pass:focus { background-color: white; width: 300px; color: #53e3a6; } form button { -webkit-appearance: none; -moz-appearance: none; appearance: none; outline: 0; background-color: rgba(255, 255, 255, 0.2); border: 0; padding: 10px 15px; color: #fff; border-radius: 3px; width: 250px; cursor: pointer; font-size: 18px; -webkit-transition-duration: 0.25s; transition-duration: 0.25s; } form button.login { -webkit-appearance: none; -moz-appearance: none; appearance: none; outline: 0; background-color: white; border: 0; padding: 10px 15px; color: #000; font-weight: bold; border-radius: 3px; width: 250px; cursor: pointer; font-size: 18px; -webkit-transition-duration: 0.25s; transition-duration: 0.25s; } form button:hover { background-color: #f5f7f9; color: #53e3a6; } .to-register { margin: 20px 0; } .to-register a.register { color: #fff !important; margin-right: 20px; } .bg-bubbles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; } .bg-bubbles li { position: absolute; list-style: none; display: block; width: 40px; height: 40px; background-color: rgba(255, 255, 255, 0.15); bottom: -160px; -webkit-animation: square 25s infinite; animation: square 25s infinite; -webkit-transition-timing-function: linear; transition-timing-function: linear; } .bg-bubbles li:nth-child(1) { left: 10%; } .bg-bubbles li:nth-child(2) { left: 20%; width: 80px; height: 80px; -webkit-animation-delay: 2s; animation-delay: 2s; -webkit-animation-duration: 17s; animation-duration: 17s; } .bg-bubbles li:nth-child(3) { left: 25%; -webkit-animation-delay: 4s; animation-delay: 4s; } .bg-bubbles li:nth-child(4) { left: 40%; width: 60px; height: 60px; -webkit-animation-duration: 22s; animation-duration: 22s; background-color: rgba(255, 255, 255, 0.25); } .bg-bubbles li:nth-child(5) { left: 70%; } .bg-bubbles li:nth-child(6) { left: 80%; width: 120px; height: 120px; -webkit-animation-delay: 3s; animation-delay: 3s; background-color: rgba(255, 255, 255, 0.2); } .bg-bubbles li:nth-child(7) { left: 32%; width: 160px; height: 160px; -webkit-animation-delay: 7s; animation-delay: 7s; } .bg-bubbles li:nth-child(8) { left: 55%; width: 20px; height: 20px; -webkit-animation-delay: 15s; animation-delay: 15s; -webkit-animation-duration: 40s; animation-duration: 40s; } .bg-bubbles li:nth-child(9) { left: 25%; width: 10px; height: 10px; -webkit-animation-delay: 2s; animation-delay: 2s; -webkit-animation-duration: 40s; animation-duration: 40s; background-color: rgba(255, 255, 255, 0.3); } .bg-bubbles li:nth-child(10) { left: 90%; width: 160px; height: 160px; -webkit-animation-delay: 11s; animation-delay: 11s; } @-webkit-keyframes square { 0% { -webkit-transform: translateY(0); transform: translateY(0); } 100% { -webkit-transform: translateY(-700px) rotate(600deg); transform: translateY(-700px) rotate(600deg); } } @keyframes square { 0% { -webkit-transform: translateY(0); transform: translateY(0); } 100% { -webkit-transform: translateY(-700px) rotate(600deg); transform: translateY(-700px) rotate(600deg); } } .home-from { margin: 60px; } .home-from a { color: #f9ac4b; } .pass-with-show div { width: 250px !important; margin: 0 auto !important; } /* fallback */ @font-face { font-family: 'Material Icons'; font-style: normal; font-weight: 400; src: url('fluhrq6tzzclqej-vdg-iuiadsnc.woff2') format('woff2'); } .material-icons { font-family: 'Material Icons'; font-weight: normal; font-style: normal; font-size: 18px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; } .add-on.input-group-addon { position: absolute; right: 5px; top: 10px; } .pass-with-show input { width: 250px; } ================================================ FILE: Blog.IdentityServer/wwwroot/css/showtip.css ================================================ .alert { position: fixed !important; top: 200px !important; left: 50% !important; } ================================================ FILE: Blog.IdentityServer/wwwroot/css/site.css ================================================ body { margin-top: 65px; } .navbar-header { position: relative; top: -4px; } .navbar-brand > .icon-banner { position: relative; top: -2px; display: inline; } .icon { position: relative; top: -3px; } .logged-out iframe { display: none; width: 0; height: 0; } .page-consent .client-logo { float: left; } .page-consent .client-logo img { width: 80px; height: 80px; } .page-consent .consent-buttons { margin-top: 25px; } .page-consent .consent-form .consent-scopecheck { display: inline-block; margin-right: 5px; } .page-consent .consent-form .consent-description { margin-left: 25px; } .page-consent .consent-form .consent-description label { font-weight: normal; } .page-consent .consent-form .consent-remember { padding-left: 16px; } .grants .page-header { margin-bottom: 10px; } .grants .grant { margin-top: 20px; padding-bottom: 20px; border-bottom: 1px solid lightgray; } .grants .grant img { width: 100px; height: 100px; } .grants .grant .clientname { font-size: 140%; font-weight: bold; } .grants .grant .granttype { font-size: 120%; font-weight: bold; } .grants .grant .created { font-size: 120%; font-weight: bold; } .grants .grant .expires { font-size: 120%; font-weight: bold; } .grants .grant li { list-style-type: none; display: inline; } .grants .grant li:after { content: ', '; } .grants .grant li:last-child:after { content: ''; } ================================================ FILE: Blog.IdentityServer/wwwroot/css/site.less ================================================ body { margin-top: 65px; } .navbar-header { position: relative; top: -4px; } .navbar-brand > .icon-banner { position: relative; top: -2px; display: inline; } .icon { position: relative; top: -10px; } .logged-out iframe { display: none; width: 0; height: 0; } .page-consent { .client-logo { float: left; img { width: 80px; height: 80px; } } .consent-buttons { margin-top: 25px; } .consent-form { .consent-scopecheck { display: inline-block; margin-right: 5px; } .consent-scopecheck[disabled] { //visibility:hidden; } .consent-description { margin-left: 25px; label { font-weight: normal; } } .consent-remember { padding-left: 16px; } } } .grants { .page-header { margin-bottom: 10px; } .grant { margin-top: 20px; padding-bottom: 20px; border-bottom: 1px solid lightgray; img { width: 100px; height: 100px; } .clientname { font-size: 140%; font-weight: bold; } .granttype { font-size: 120%; font-weight: bold; } .created { font-size: 120%; font-weight: bold; } .expires { font-size: 120%; font-weight: bold; } li { list-style-type: none; display: inline; &:after { content: ', '; } &:last-child:after { content: ''; } .displayname { } } } } ================================================ FILE: Blog.IdentityServer/wwwroot/css/web.css ================================================ /*Common*/ @media (max-width: 767px) { .menu { text-align: center; } .menu-logo { font-size: 1.2em; } .menu-item { display: none; } .menu-button { display: block; } .welcome-block h1 { font-size: 2em; } } @media (min-width: 768px) { .menu-item { display: block; } .menu-button { display: none; } } .gravatar-image { max-width: none; } .border-top { border-top: 1px solid #e5e5e5; } .border-bottom { border-bottom: 1px solid #e5e5e5; } .box-shadow { box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05); } .welcome-block { max-width: 700px; } .logo, .logo:hover { color: black; text-decoration: none; } .col-m-5 { margin: 5px; } .col-m-10 { margin: 10px; } .col-m-15 { margin: 15px; } .col-m-20 { margin: 20px; } .col-m-25 { margin: 25px; } .col-m-30 { margin: 30px; } .col-m-35 { margin: 35px; } .col-m-40 { margin: 40px; } .col-m-45 { margin: 45px; } .col-m-50 { margin: 50px; } .col-m-b-5 { margin-bottom: 5px; } .col-m-b-10 { margin-bottom: 10px; } .col-m-b-15 { margin-bottom: 15px; } .col-m-b-20 { margin-bottom: 20px; } .col-m-b-25 { margin-bottom: 25px; } .col-m-b-30 { margin-bottom: 30px; } .col-m-b-35 { margin-bottom: 35px; } .col-m-b-40 { margin-bottom: 40px; } .col-m-b-45 { margin-bottom: 45px; } .col-m-b-50 { margin-bottom: 50px; } .col-m-t-5 { margin-top: 5px; } .col-m-t-10 { margin-top: 10px; } .col-m-t-15 { margin-top: 15px; } .col-m-t-20 { margin-top: 20px; } .col-m-t-25 { margin-top: 25px; } .col-m-t-30 { margin-top: 30px; } .col-m-t-35 { margin-top: 35px; } .col-m-t-40 { margin-top: 40px; } .col-m-t-45 { margin-top: 45px; } .col-m-t-50 { margin-top: 50px; } .col-m-l-5 { margin-left: 5px; } .col-m-l-10 { margin-left: 10px; } .col-m-l-15 { margin-left: 15px; } .col-m-l-20 { margin-left: 20px; } .col-m-l-25 { margin-left: 25px; } .col-m-l-30 { margin-left: 30px; } .col-m-l-35 { margin-left: 35px; } .col-m-l-40 { margin-left: 40px; } .col-m-l-45 { margin-left: 45px; } .col-m-l-50 { margin-left: 50px; } .col-m-r-5 { margin-right: 5px; } .col-m-r-10 { margin-right: 10px; } .col-m-r-15 { margin-right: 15px; } .col-m-r-20 { margin-right: 20px; } .col-m-r-25 { margin-right: 25px; } .col-m-r-30 { margin-right: 30px; } .col-m-r-35 { margin-right: 35px; } .col-m-r-40 { margin-right: 40px; } .col-m-r-45 { margin-right: 45px; } .col-m-r-50 { margin-right: 50px; } .col-p-5 { padding: 5px; } .col-p-10 { padding: 10px; } .col-p-15 { padding: 15px; } .col-p-20 { padding: 20px; } .col-p-25 { padding: 25px; } .col-p-30 { padding: 30px; } .col-p-35 { padding: 35px; } .col-p-40 { padding: 40px; } .col-p-45 { padding: 45px; } .col-p-50 { padding: 50px; } .col-p-b-5 { padding-bottom: 5px; } .col-p-b-10 { padding-bottom: 10px; } .col-p-b-15 { padding-bottom: 15px; } .col-p-b-20 { padding-bottom: 20px; } .col-p-b-25 { padding-bottom: 25px; } .col-p-b-30 { padding-bottom: 30px; } .col-p-b-35 { padding-bottom: 35px; } .col-p-b-40 { padding-bottom: 40px; } .col-p-b-45 { padding-bottom: 45px; } .col-p-b-50 { padding-bottom: 50px; } .col-p-t-5 { padding-top: 5px; } .col-p-t-10 { padding-top: 10px; } .col-p-t-15 { padding-top: 15px; } .col-p-t-20 { padding-top: 20px; } .col-p-t-25 { padding-top: 25px; } .col-p-t-30 { padding-top: 30px; } .col-p-t-35 { padding-top: 35px; } .col-p-t-40 { padding-top: 40px; } .col-p-t-45 { padding-top: 45px; } .col-p-t-50 { padding-top: 50px; } .col-p-l-5 { padding-left: 5px; } .col-p-l-10 { padding-left: 10px; } .col-p-l-15 { padding-left: 15px; } .col-p-l-20 { padding-left: 20px; } .col-p-l-25 { padding-left: 25px; } .col-p-l-30 { padding-left: 30px; } .col-p-l-35 { padding-left: 35px; } .col-p-l-40 { padding-left: 40px; } .col-p-l-45 { padding-left: 45px; } .col-p-l-50 { padding-left: 50px; } .col-p-r-5 { padding-right: 5px; } .col-p-r-10 { padding-right: 10px; } .col-p-r-15 { padding-right: 15px; } .col-p-r-20 { padding-right: 20px; } .col-p-r-25 { padding-right: 25px; } .col-p-r-30 { padding-right: 30px; } .col-p-r-35 { padding-right: 35px; } .col-p-r-40 { padding-right: 40px; } .col-p-r-45 { padding-right: 45px; } .col-p-r-50 { padding-right: 50px; } .col-form-label { text-align: right; font-weight: bold; } @media (max-width: 575px) { .col-form-label { text-align: left; } } /*Controls*/ .navbar-brand > img { max-height: 31px; } .navbar-brand.logo { padding: 10px 10px; } .navbar-brand-image-mobile { display: none; } @media (max-width: 767px) { .navbar-brand-image { display: none; } .navbar-brand-image-mobile { display: block; padding-left: 0; padding-right: 0; } } .validation-summary-errors { color: #ff3834; border: 1px solid #ffd3d3; background: none; padding-top: 9px; -ms-border-radius: 4px; border-radius: 4px; margin-bottom: 15px; margin-top: 20px; } .switch { display: inline-block; height: 28px; position: relative; width: 60px; margin-top: 5px; } .switch input { display: none; } .slider { background-color: #ccc; bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0; transition: .4s; } .slider:before { background-color: #fff; bottom: 4px; content: ""; height: 20px; left: 7px; position: absolute; transition: .4s; width: 20px; } input:checked + .slider { background-color: #007bff; } input:checked + .slider:before { transform: translateX(26px); } .slider.round { border-radius: 34px; } .slider.round:before { border-radius: 50%; } .picker hr { margin-bottom: 5px; } .picker .button__text { display: inline-block; text-align: center; vertical-align: middle; margin: 3px; border: 1px solid transparent; padding: .375rem .75rem; font-size: 1rem; line-height: 1.5; border-radius: .25rem; border-color: #007bff; color: #007bff; } .picker .button__add { margin-top: 5px; margin-bottom: 5px; margin-right: 5px; white-space: normal; text-transform: none; } .picker .button__delete, .picker .button__update { margin-top: 5px; margin-bottom: 5px; margin-right: 5px; white-space: normal; text-transform: none; } .picker .button__show-all { margin-top: 5px; margin-bottom: 5px; margin-right: 5px; white-space: normal; text-transform: none; } .picker .block__buttons__add { margin-top: 4px; } .picker .search-title { color: gray; font-size: 12px; } #toast-container > div { opacity: 1; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); filter: alpha(opacity=100); } label.radio-img > input { visibility: hidden; position: absolute; } label.radio-img > input + img { cursor: pointer; border: 2px solid transparent; } label.radio-img > input:checked + img { background-color: #ffe7ac; -ms-border-radius: 15px; border-radius: 15px; } label.radio-img > input:checked ~ h3, label.radio-img > input:checked ~ h4 { color: #007bff; text-decoration: underline; } label.radio-img > h3, label > h4 { cursor: pointer; } /*Pages*/ .client .action-butons { margin: 20px 0 20px 0; } .audit-log-container .modal-dialog { overflow-y: initial !important; } .audit-log-container .modal-body { max-height: calc(100vh - 200px); overflow-y: auto; } .width100p { width: 100% !important; } .content-bd { margin: 0 20px; } .row.grant { border-top: 1px dashed gray; padding-top: 10px; } h5.Grant-Config { font-size: 1.25rem; background: beige; padding: 10px 20px; } .grey888 { color: #888; font-size: 14px; } .grey888 div { margin: 3px; } .pwd-qus-tip { font-size: 12px; color: red; } .create-item { width: 300px; } a.reset { color: greenyellow !important; } ================================================ FILE: Blog.IdentityServer/wwwroot/js/Role.js ================================================ var Roleid = ''; $(".viewbtn").on("click", function () { Roleid = $(this).data('id'); }); $(".deletebutton").on("click", function () { if (Roleid) { $.post("/account/roledelete/" + Roleid, null, function () { history.go(0); ShowSuccess("删除成功!"); }) .error(function () { $('#DeleteRole').modal('hide'); ShowFailure("删除失败,无权限!"); }); } }); ================================================ FILE: Blog.IdentityServer/wwwroot/js/User.js ================================================ var userid = ''; $(".viewbtn").on("click", function () { userid = $(this).data('id'); }); $(".deletebutton").on("click", function () { if (userid) { $.post("/account/delete/" + userid, null, function () { history.go(0); ShowSuccess("删除成功!"); }) .error(function () { $('#DeleteUser').modal('hide'); ShowFailure("删除失败,无权限!"); }); } }); ================================================ FILE: Blog.IdentityServer/wwwroot/js/bootstrap-show-password.js ================================================ /** * @author zhixin wen * https://github.com/wenzhixin/bootstrap-show-password * version: 1.1.2 */ !function ($) { 'use strict'; // TOOLS DEFINITION // ====================== // it only does '%s', and return '' when arguments are undefined var sprintf = function(str) { var args = arguments, flag = true, i = 1; str = str.replace(/%s/g, function () { var arg = args[i++]; if (typeof arg === 'undefined') { flag = false; return ''; } return arg; }); if (flag) { return str; } return ''; }; // PASSWORD CLASS DEFINITION // ====================== var Password = function(element, options) { this.options = options; this.$element = $(element); this.isShown = false; this.init(); }; Password.DEFAULTS = { placement: 'after', // 'before' or 'after' white: false, // v2 message: 'Click here to show/hide password', eyeClass: 'glyphicon', eyeOpenClass: 'glyphicon-eye-open', eyeCloseClass: 'glyphicon-eye-close', eyeClassPositionInside: false }; Password.prototype.init = function() { var placementFuc, inputClass; // v2 class if (this.options.placement === 'before') { placementFuc = 'insertBefore'; inputClass = 'input-prepend'; } else { this.options.placement = 'after'; // default to after placementFuc = 'insertAfter'; inputClass = 'input-append'; } // Create the text, icon and assign this.$element.wrap(sprintf('
    ', inputClass)); this.$text = $('') [placementFuc](this.$element) .attr('class', this.$element.attr('class')) .attr('style', this.$element.attr('style')) .attr('placeholder', this.$element.attr('placeholder')) .css('display', this.$element.css('display')) .val(this.$element.val()).hide(); // Copy readonly attribute if it's set if (this.$element.prop('readonly')) this.$text.prop('readonly', true); this.$icon = $([ '', '' + (this.options.eyeClassPositionInside ? this.options.eyeOpenClass : '') + '', '' ].join(''))[placementFuc](this.$text).css('cursor', 'pointer'); // events this.$text.off('keyup').on('keyup', $.proxy(function() { if (!this.isShown) return; this.$element.val(this.$text.val()).trigger('change'); }, this)); this.$icon.off('click').on('click', $.proxy(function() { this.$text.val(this.$element.val()).trigger('change'); this.toggle(); }, this)); }; Password.prototype.toggle = function(_relatedTarget) { this[!this.isShown ? 'show' : 'hide'](_relatedTarget); }; Password.prototype.show = function(_relatedTarget) { var e = $.Event('show.bs.password', {relatedTarget: _relatedTarget}); this.$element.trigger(e); this.isShown = true; this.$element.hide(); this.$text.show(); if (this.options.eyeClassPositionInside) { this.$icon.find('i') .removeClass('icon-eye-open') .addClass('icon-eye-close') .html(this.options.eyeCloseClass); } else { this.$icon.find('i') .removeClass('icon-eye-open ' + this.options.eyeOpenClass) .addClass('icon-eye-close ' + this.options.eyeCloseClass); } // v3 input-group this.$text[this.options.placement](this.$element); }; Password.prototype.hide = function(_relatedTarget) { var e = $.Event('hide.bs.password', {relatedTarget: _relatedTarget}); this.$element.trigger(e); this.isShown = false; this.$element.show(); this.$text.hide(); if (this.options.eyeClassPositionInside) { this.$icon.find('i') .removeClass('icon-eye-close') .addClass('icon-eye-open') .html(this.options.eyeOpenClass); } else { this.$icon.find('i') .removeClass('icon-eye-close ' + this.options.eyeCloseClass) .addClass('icon-eye-open ' + this.options.eyeOpenClass); } // v3 input-group this.$element[this.options.placement](this.$text); }; Password.prototype.val = function (value) { if (typeof value === 'undefined') { return this.$element.val(); } else { this.$element.val(value).trigger('change'); this.$text.val(value); } }; Password.prototype.focus = function () { this.$element.focus(); }; // PASSWORD PLUGIN DEFINITION // ======================= var old = $.fn.password; $.fn.password = function() { var option = arguments[0], args = arguments, value, allowedMethods = [ 'show', 'hide', 'toggle', 'val', 'focus' ]; // public function this.each(function() { var $this = $(this), data = $this.data('bs.password'), options = $.extend({}, Password.DEFAULTS, $this.data(), typeof option === 'object' && option); if (typeof option === 'string') { if ($.inArray(option, allowedMethods) < 0) { throw "Unknown method: " + option; } value = data[option](args[1]); } else { if (!data) { data = new Password($this, options); $this.data('bs.password', data); } else { data.init(options); } } }); return value ? value : this; }; $.fn.password.Constructor = Password; // PASSWORD NO CONFLICT // ================= $.fn.password.noConflict = function() { $.fn.password = old; return this; }; $(function () { $('[data-toggle="password"]').password(); }); }(window.jQuery); ================================================ FILE: Blog.IdentityServer/wwwroot/js/showTip.js ================================================ //tip是提示信息,type:'success'是成功信息,'danger'是失败信息,'info'是普通信息 function ShowTip(tip, type) { var $tip = $('#tip'); if ($tip.length == 0) { $tip = $(''); $('body').append($tip); } $tip.stop(true).attr('class', 'alert alert-' + type).text(tip).css('margin-left', -$tip.outerWidth() / 2).fadeIn(500).delay(2000).fadeOut(500); } function ShowMsg(msg) { ShowTip(msg, 'info'); } function ShowSuccess(msg) { ShowTip(msg, 'success'); } function ShowFailure(msg) { ShowTip(msg, 'danger'); } function ShowWarn(msg, $focus, clear) { ShowTip(msg, 'warning'); if ($focus) $focus.focus(); if (clear) $focus.val(''); return false; } ================================================ FILE: Blog.IdentityServer/wwwroot/js/signin-redirect.js ================================================ window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); ================================================ FILE: Blog.IdentityServer/wwwroot/js/signout-redirect.js ================================================ window.addEventListener("load", function () { var a = document.querySelector("a.PostLogoutRedirectUri"); if (a) { window.location = a.href; } }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/bootstrap/css/bootstrap.css ================================================ /*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ html { font-family: sans-serif; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } body { margin: 0; } article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } audio, canvas, progress, video { display: inline-block; vertical-align: baseline; } audio:not([controls]) { display: none; height: 0; } [hidden], template { display: none; } a { background-color: transparent; } a:active, a:hover { outline: 0; } abbr[title] { border-bottom: 1px dotted; } b, strong { font-weight: bold; } dfn { font-style: italic; } h1 { margin: .67em 0; font-size: 2em; } mark { color: #000; background: #ff0; } small { font-size: 80%; } sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; } sup { top: -.5em; } sub { bottom: -.25em; } img { border: 0; } svg:not(:root) { overflow: hidden; } figure { margin: 1em 40px; } hr { height: 0; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; } pre { overflow: auto; } code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } button, input, optgroup, select, textarea { margin: 0; font: inherit; color: inherit; } button { overflow: visible; } button, select { text-transform: none; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], html input[disabled] { cursor: default; } button::-moz-focus-inner, input::-moz-focus-inner { padding: 0; border: 0; } input { line-height: normal; } input[type="checkbox"], input[type="radio"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding: 0; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } input[type="search"] { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -webkit-appearance: textfield; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } fieldset { padding: .35em .625em .75em; margin: 0 2px; border: 1px solid #c0c0c0; } legend { padding: 0; border: 0; } textarea { overflow: auto; } optgroup { font-weight: bold; } table { border-spacing: 0; border-collapse: collapse; } td, th { padding: 0; } /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ @media print { *, *:before, *:after { color: #000 !important; text-shadow: none !important; background: transparent !important; -webkit-box-shadow: none !important; box-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } .navbar { display: none; } .btn > .caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table td, .table th { background-color: #fff !important; } .table-bordered th, .table-bordered td { border: 1px solid #ddd !important; } } @font-face { font-family: 'Glyphicons Halflings'; src: url('../fonts/glyphicons-halflings-regular.eot'); src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); } .glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .glyphicon-asterisk:before { content: "\2a"; } .glyphicon-plus:before { content: "\2b"; } .glyphicon-euro:before, .glyphicon-eur:before { content: "\20ac"; } .glyphicon-minus:before { content: "\2212"; } .glyphicon-cloud:before { content: "\2601"; } .glyphicon-envelope:before { content: "\2709"; } .glyphicon-pencil:before { content: "\270f"; } .glyphicon-glass:before { content: "\e001"; } .glyphicon-music:before { content: "\e002"; } .glyphicon-search:before { content: "\e003"; } .glyphicon-heart:before { content: "\e005"; } .glyphicon-star:before { content: "\e006"; } .glyphicon-star-empty:before { content: "\e007"; } .glyphicon-user:before { content: "\e008"; } .glyphicon-film:before { content: "\e009"; } .glyphicon-th-large:before { content: "\e010"; } .glyphicon-th:before { content: "\e011"; } .glyphicon-th-list:before { content: "\e012"; } .glyphicon-ok:before { content: "\e013"; } .glyphicon-remove:before { content: "\e014"; } .glyphicon-zoom-in:before { content: "\e015"; } .glyphicon-zoom-out:before { content: "\e016"; } .glyphicon-off:before { content: "\e017"; } .glyphicon-signal:before { content: "\e018"; } .glyphicon-cog:before { content: "\e019"; } .glyphicon-trash:before { content: "\e020"; } .glyphicon-home:before { content: "\e021"; } .glyphicon-file:before { content: "\e022"; } .glyphicon-time:before { content: "\e023"; } .glyphicon-road:before { content: "\e024"; } .glyphicon-download-alt:before { content: "\e025"; } .glyphicon-download:before { content: "\e026"; } .glyphicon-upload:before { content: "\e027"; } .glyphicon-inbox:before { content: "\e028"; } .glyphicon-play-circle:before { content: "\e029"; } .glyphicon-repeat:before { content: "\e030"; } .glyphicon-refresh:before { content: "\e031"; } .glyphicon-list-alt:before { content: "\e032"; } .glyphicon-lock:before { content: "\e033"; } .glyphicon-flag:before { content: "\e034"; } .glyphicon-headphones:before { content: "\e035"; } .glyphicon-volume-off:before { content: "\e036"; } .glyphicon-volume-down:before { content: "\e037"; } .glyphicon-volume-up:before { content: "\e038"; } .glyphicon-qrcode:before { content: "\e039"; } .glyphicon-barcode:before { content: "\e040"; } .glyphicon-tag:before { content: "\e041"; } .glyphicon-tags:before { content: "\e042"; } .glyphicon-book:before { content: "\e043"; } .glyphicon-bookmark:before { content: "\e044"; } .glyphicon-print:before { content: "\e045"; } .glyphicon-camera:before { content: "\e046"; } .glyphicon-font:before { content: "\e047"; } .glyphicon-bold:before { content: "\e048"; } .glyphicon-italic:before { content: "\e049"; } .glyphicon-text-height:before { content: "\e050"; } .glyphicon-text-width:before { content: "\e051"; } .glyphicon-align-left:before { content: "\e052"; } .glyphicon-align-center:before { content: "\e053"; } .glyphicon-align-right:before { content: "\e054"; } .glyphicon-align-justify:before { content: "\e055"; } .glyphicon-list:before { content: "\e056"; } .glyphicon-indent-left:before { content: "\e057"; } .glyphicon-indent-right:before { content: "\e058"; } .glyphicon-facetime-video:before { content: "\e059"; } .glyphicon-picture:before { content: "\e060"; } .glyphicon-map-marker:before { content: "\e062"; } .glyphicon-adjust:before { content: "\e063"; } .glyphicon-tint:before { content: "\e064"; } .glyphicon-edit:before { content: "\e065"; } .glyphicon-share:before { content: "\e066"; } .glyphicon-check:before { content: "\e067"; } .glyphicon-move:before { content: "\e068"; } .glyphicon-step-backward:before { content: "\e069"; } .glyphicon-fast-backward:before { content: "\e070"; } .glyphicon-backward:before { content: "\e071"; } .glyphicon-play:before { content: "\e072"; } .glyphicon-pause:before { content: "\e073"; } .glyphicon-stop:before { content: "\e074"; } .glyphicon-forward:before { content: "\e075"; } .glyphicon-fast-forward:before { content: "\e076"; } .glyphicon-step-forward:before { content: "\e077"; } .glyphicon-eject:before { content: "\e078"; } .glyphicon-chevron-left:before { content: "\e079"; } .glyphicon-chevron-right:before { content: "\e080"; } .glyphicon-plus-sign:before { content: "\e081"; } .glyphicon-minus-sign:before { content: "\e082"; } .glyphicon-remove-sign:before { content: "\e083"; } .glyphicon-ok-sign:before { content: "\e084"; } .glyphicon-question-sign:before { content: "\e085"; } .glyphicon-info-sign:before { content: "\e086"; } .glyphicon-screenshot:before { content: "\e087"; } .glyphicon-remove-circle:before { content: "\e088"; } .glyphicon-ok-circle:before { content: "\e089"; } .glyphicon-ban-circle:before { content: "\e090"; } .glyphicon-arrow-left:before { content: "\e091"; } .glyphicon-arrow-right:before { content: "\e092"; } .glyphicon-arrow-up:before { content: "\e093"; } .glyphicon-arrow-down:before { content: "\e094"; } .glyphicon-share-alt:before { content: "\e095"; } .glyphicon-resize-full:before { content: "\e096"; } .glyphicon-resize-small:before { content: "\e097"; } .glyphicon-exclamation-sign:before { content: "\e101"; } .glyphicon-gift:before { content: "\e102"; } .glyphicon-leaf:before { content: "\e103"; } .glyphicon-fire:before { content: "\e104"; } .glyphicon-eye-open:before { content: "\e105"; } .glyphicon-eye-close:before { content: "\e106"; } .glyphicon-warning-sign:before { content: "\e107"; } .glyphicon-plane:before { content: "\e108"; } .glyphicon-calendar:before { content: "\e109"; } .glyphicon-random:before { content: "\e110"; } .glyphicon-comment:before { content: "\e111"; } .glyphicon-magnet:before { content: "\e112"; } .glyphicon-chevron-up:before { content: "\e113"; } .glyphicon-chevron-down:before { content: "\e114"; } .glyphicon-retweet:before { content: "\e115"; } .glyphicon-shopping-cart:before { content: "\e116"; } .glyphicon-folder-close:before { content: "\e117"; } .glyphicon-folder-open:before { content: "\e118"; } .glyphicon-resize-vertical:before { content: "\e119"; } .glyphicon-resize-horizontal:before { content: "\e120"; } .glyphicon-hdd:before { content: "\e121"; } .glyphicon-bullhorn:before { content: "\e122"; } .glyphicon-bell:before { content: "\e123"; } .glyphicon-certificate:before { content: "\e124"; } .glyphicon-thumbs-up:before { content: "\e125"; } .glyphicon-thumbs-down:before { content: "\e126"; } .glyphicon-hand-right:before { content: "\e127"; } .glyphicon-hand-left:before { content: "\e128"; } .glyphicon-hand-up:before { content: "\e129"; } .glyphicon-hand-down:before { content: "\e130"; } .glyphicon-circle-arrow-right:before { content: "\e131"; } .glyphicon-circle-arrow-left:before { content: "\e132"; } .glyphicon-circle-arrow-up:before { content: "\e133"; } .glyphicon-circle-arrow-down:before { content: "\e134"; } .glyphicon-globe:before { content: "\e135"; } .glyphicon-wrench:before { content: "\e136"; } .glyphicon-tasks:before { content: "\e137"; } .glyphicon-filter:before { content: "\e138"; } .glyphicon-briefcase:before { content: "\e139"; } .glyphicon-fullscreen:before { content: "\e140"; } .glyphicon-dashboard:before { content: "\e141"; } .glyphicon-paperclip:before { content: "\e142"; } .glyphicon-heart-empty:before { content: "\e143"; } .glyphicon-link:before { content: "\e144"; } .glyphicon-phone:before { content: "\e145"; } .glyphicon-pushpin:before { content: "\e146"; } .glyphicon-usd:before { content: "\e148"; } .glyphicon-gbp:before { content: "\e149"; } .glyphicon-sort:before { content: "\e150"; } .glyphicon-sort-by-alphabet:before { content: "\e151"; } .glyphicon-sort-by-alphabet-alt:before { content: "\e152"; } .glyphicon-sort-by-order:before { content: "\e153"; } .glyphicon-sort-by-order-alt:before { content: "\e154"; } .glyphicon-sort-by-attributes:before { content: "\e155"; } .glyphicon-sort-by-attributes-alt:before { content: "\e156"; } .glyphicon-unchecked:before { content: "\e157"; } .glyphicon-expand:before { content: "\e158"; } .glyphicon-collapse-down:before { content: "\e159"; } .glyphicon-collapse-up:before { content: "\e160"; } .glyphicon-log-in:before { content: "\e161"; } .glyphicon-flash:before { content: "\e162"; } .glyphicon-log-out:before { content: "\e163"; } .glyphicon-new-window:before { content: "\e164"; } .glyphicon-record:before { content: "\e165"; } .glyphicon-save:before { content: "\e166"; } .glyphicon-open:before { content: "\e167"; } .glyphicon-saved:before { content: "\e168"; } .glyphicon-import:before { content: "\e169"; } .glyphicon-export:before { content: "\e170"; } .glyphicon-send:before { content: "\e171"; } .glyphicon-floppy-disk:before { content: "\e172"; } .glyphicon-floppy-saved:before { content: "\e173"; } .glyphicon-floppy-remove:before { content: "\e174"; } .glyphicon-floppy-save:before { content: "\e175"; } .glyphicon-floppy-open:before { content: "\e176"; } .glyphicon-credit-card:before { content: "\e177"; } .glyphicon-transfer:before { content: "\e178"; } .glyphicon-cutlery:before { content: "\e179"; } .glyphicon-header:before { content: "\e180"; } .glyphicon-compressed:before { content: "\e181"; } .glyphicon-earphone:before { content: "\e182"; } .glyphicon-phone-alt:before { content: "\e183"; } .glyphicon-tower:before { content: "\e184"; } .glyphicon-stats:before { content: "\e185"; } .glyphicon-sd-video:before { content: "\e186"; } .glyphicon-hd-video:before { content: "\e187"; } .glyphicon-subtitles:before { content: "\e188"; } .glyphicon-sound-stereo:before { content: "\e189"; } .glyphicon-sound-dolby:before { content: "\e190"; } .glyphicon-sound-5-1:before { content: "\e191"; } .glyphicon-sound-6-1:before { content: "\e192"; } .glyphicon-sound-7-1:before { content: "\e193"; } .glyphicon-copyright-mark:before { content: "\e194"; } .glyphicon-registration-mark:before { content: "\e195"; } .glyphicon-cloud-download:before { content: "\e197"; } .glyphicon-cloud-upload:before { content: "\e198"; } .glyphicon-tree-conifer:before { content: "\e199"; } .glyphicon-tree-deciduous:before { content: "\e200"; } .glyphicon-cd:before { content: "\e201"; } .glyphicon-save-file:before { content: "\e202"; } .glyphicon-open-file:before { content: "\e203"; } .glyphicon-level-up:before { content: "\e204"; } .glyphicon-copy:before { content: "\e205"; } .glyphicon-paste:before { content: "\e206"; } .glyphicon-alert:before { content: "\e209"; } .glyphicon-equalizer:before { content: "\e210"; } .glyphicon-king:before { content: "\e211"; } .glyphicon-queen:before { content: "\e212"; } .glyphicon-pawn:before { content: "\e213"; } .glyphicon-bishop:before { content: "\e214"; } .glyphicon-knight:before { content: "\e215"; } .glyphicon-baby-formula:before { content: "\e216"; } .glyphicon-tent:before { content: "\26fa"; } .glyphicon-blackboard:before { content: "\e218"; } .glyphicon-bed:before { content: "\e219"; } .glyphicon-apple:before { content: "\f8ff"; } .glyphicon-erase:before { content: "\e221"; } .glyphicon-hourglass:before { content: "\231b"; } .glyphicon-lamp:before { content: "\e223"; } .glyphicon-duplicate:before { content: "\e224"; } .glyphicon-piggy-bank:before { content: "\e225"; } .glyphicon-scissors:before { content: "\e226"; } .glyphicon-bitcoin:before { content: "\e227"; } .glyphicon-btc:before { content: "\e227"; } .glyphicon-xbt:before { content: "\e227"; } .glyphicon-yen:before { content: "\00a5"; } .glyphicon-jpy:before { content: "\00a5"; } .glyphicon-ruble:before { content: "\20bd"; } .glyphicon-rub:before { content: "\20bd"; } .glyphicon-scale:before { content: "\e230"; } .glyphicon-ice-lolly:before { content: "\e231"; } .glyphicon-ice-lolly-tasted:before { content: "\e232"; } .glyphicon-education:before { content: "\e233"; } .glyphicon-option-horizontal:before { content: "\e234"; } .glyphicon-option-vertical:before { content: "\e235"; } .glyphicon-menu-hamburger:before { content: "\e236"; } .glyphicon-modal-window:before { content: "\e237"; } .glyphicon-oil:before { content: "\e238"; } .glyphicon-grain:before { content: "\e239"; } .glyphicon-sunglasses:before { content: "\e240"; } .glyphicon-text-size:before { content: "\e241"; } .glyphicon-text-color:before { content: "\e242"; } .glyphicon-text-background:before { content: "\e243"; } .glyphicon-object-align-top:before { content: "\e244"; } .glyphicon-object-align-bottom:before { content: "\e245"; } .glyphicon-object-align-horizontal:before { content: "\e246"; } .glyphicon-object-align-left:before { content: "\e247"; } .glyphicon-object-align-vertical:before { content: "\e248"; } .glyphicon-object-align-right:before { content: "\e249"; } .glyphicon-triangle-right:before { content: "\e250"; } .glyphicon-triangle-left:before { content: "\e251"; } .glyphicon-triangle-bottom:before { content: "\e252"; } .glyphicon-triangle-top:before { content: "\e253"; } .glyphicon-console:before { content: "\e254"; } .glyphicon-superscript:before { content: "\e255"; } .glyphicon-subscript:before { content: "\e256"; } .glyphicon-menu-left:before { content: "\e257"; } .glyphicon-menu-right:before { content: "\e258"; } .glyphicon-menu-down:before { content: "\e259"; } .glyphicon-menu-up:before { content: "\e260"; } * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html { font-size: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.42857143; color: #333; background-color: #fff; } input, button, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; } a { color: #337ab7; text-decoration: none; } a:hover, a:focus { color: #23527c; text-decoration: underline; } a:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } figure { margin: 0; } img { vertical-align: middle; } .img-responsive, .thumbnail > img, .thumbnail a > img, .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; max-width: 100%; height: auto; } .img-rounded { border-radius: 6px; } .img-thumbnail { display: inline-block; max-width: 100%; height: auto; padding: 4px; line-height: 1.42857143; background-color: #fff; border: 1px solid #ddd; border-radius: 4px; -webkit-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out; transition: all .2s ease-in-out; } .img-circle { border-radius: 50%; } hr { margin-top: 20px; margin-bottom: 20px; border: 0; border-top: 1px solid #eee; } .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } .sr-only-focusable:active, .sr-only-focusable:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; } [role="button"] { cursor: pointer; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small { font-weight: normal; line-height: 1; color: #777; } h1, .h1, h2, .h2, h3, .h3 { margin-top: 20px; margin-bottom: 10px; } h1 small, .h1 small, h2 small, .h2 small, h3 small, .h3 small, h1 .small, .h1 .small, h2 .small, .h2 .small, h3 .small, .h3 .small { font-size: 65%; } h4, .h4, h5, .h5, h6, .h6 { margin-top: 10px; margin-bottom: 10px; } h4 small, .h4 small, h5 small, .h5 small, h6 small, .h6 small, h4 .small, .h4 .small, h5 .small, .h5 .small, h6 .small, .h6 .small { font-size: 75%; } h1, .h1 { font-size: 36px; } h2, .h2 { font-size: 30px; } h3, .h3 { font-size: 24px; } h4, .h4 { font-size: 18px; } h5, .h5 { font-size: 14px; } h6, .h6 { font-size: 12px; } p { margin: 0 0 10px; } .lead { margin-bottom: 20px; font-size: 16px; font-weight: 300; line-height: 1.4; } @media (min-width: 768px) { .lead { font-size: 21px; } } small, .small { font-size: 85%; } mark, .mark { padding: .2em; background-color: #fcf8e3; } .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } .text-justify { text-align: justify; } .text-nowrap { white-space: nowrap; } .text-lowercase { text-transform: lowercase; } .text-uppercase { text-transform: uppercase; } .text-capitalize { text-transform: capitalize; } .text-muted { color: #777; } .text-primary { color: #337ab7; } a.text-primary:hover, a.text-primary:focus { color: #286090; } .text-success { color: #3c763d; } a.text-success:hover, a.text-success:focus { color: #2b542c; } .text-info { color: #31708f; } a.text-info:hover, a.text-info:focus { color: #245269; } .text-warning { color: #8a6d3b; } a.text-warning:hover, a.text-warning:focus { color: #66512c; } .text-danger { color: #a94442; } a.text-danger:hover, a.text-danger:focus { color: #843534; } .bg-primary { color: #fff; background-color: #337ab7; } a.bg-primary:hover, a.bg-primary:focus { background-color: #286090; } .bg-success { background-color: #dff0d8; } a.bg-success:hover, a.bg-success:focus { background-color: #c1e2b3; } .bg-info { background-color: #d9edf7; } a.bg-info:hover, a.bg-info:focus { background-color: #afd9ee; } .bg-warning { background-color: #fcf8e3; } a.bg-warning:hover, a.bg-warning:focus { background-color: #f7ecb5; } .bg-danger { background-color: #f2dede; } a.bg-danger:hover, a.bg-danger:focus { background-color: #e4b9b9; } .page-header { padding-bottom: 9px; margin: 40px 0 20px; border-bottom: 1px solid #eee; } ul, ol { margin-top: 0; margin-bottom: 10px; } ul ul, ol ul, ul ol, ol ol { margin-bottom: 0; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; margin-left: -5px; list-style: none; } .list-inline > li { display: inline-block; padding-right: 5px; padding-left: 5px; } dl { margin-top: 0; margin-bottom: 20px; } dt, dd { line-height: 1.42857143; } dt { font-weight: bold; } dd { margin-left: 0; } @media (min-width: 768px) { .dl-horizontal dt { float: left; width: 160px; overflow: hidden; clear: left; text-align: right; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 180px; } } abbr[title], abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #777; } .initialism { font-size: 90%; text-transform: uppercase; } blockquote { padding: 10px 20px; margin: 0 0 20px; font-size: 17.5px; border-left: 5px solid #eee; } blockquote p:last-child, blockquote ul:last-child, blockquote ol:last-child { margin-bottom: 0; } blockquote footer, blockquote small, blockquote .small { display: block; font-size: 80%; line-height: 1.42857143; color: #777; } blockquote footer:before, blockquote small:before, blockquote .small:before { content: '\2014 \00A0'; } .blockquote-reverse, blockquote.pull-right { padding-right: 15px; padding-left: 0; text-align: right; border-right: 5px solid #eee; border-left: 0; } .blockquote-reverse footer:before, blockquote.pull-right footer:before, .blockquote-reverse small:before, blockquote.pull-right small:before, .blockquote-reverse .small:before, blockquote.pull-right .small:before { content: ''; } .blockquote-reverse footer:after, blockquote.pull-right footer:after, .blockquote-reverse small:after, blockquote.pull-right small:after, .blockquote-reverse .small:after, blockquote.pull-right .small:after { content: '\00A0 \2014'; } address { margin-bottom: 20px; font-style: normal; line-height: 1.42857143; } code, kbd, pre, samp { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; border-radius: 4px; } kbd { padding: 2px 4px; font-size: 90%; color: #fff; background-color: #333; border-radius: 3px; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); } kbd kbd { padding: 0; font-size: 100%; font-weight: bold; -webkit-box-shadow: none; box-shadow: none; } pre { display: block; padding: 9.5px; margin: 0 0 10px; font-size: 13px; line-height: 1.42857143; color: #333; word-break: break-all; word-wrap: break-word; background-color: #f5f5f5; border: 1px solid #ccc; border-radius: 4px; } pre code { padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; background-color: transparent; border-radius: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } .container { padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; } @media (min-width: 768px) { .container { width: 750px; } } @media (min-width: 992px) { .container { width: 970px; } } @media (min-width: 1200px) { .container { width: 100%; max-width: 1440px; } } .container-fluid { padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; } .row { margin-right: -15px; margin-left: -15px; } .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; } .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { float: left; } .col-xs-12 { width: 100%; } .col-xs-11 { width: 91.66666667%; } .col-xs-10 { width: 83.33333333%; } .col-xs-9 { width: 75%; } .col-xs-8 { width: 66.66666667%; } .col-xs-7 { width: 58.33333333%; } .col-xs-6 { width: 50%; } .col-xs-5 { width: 41.66666667%; } .col-xs-4 { width: 33.33333333%; } .col-xs-3 { width: 25%; } .col-xs-2 { width: 16.66666667%; } .col-xs-1 { width: 8.33333333%; } .col-xs-pull-12 { right: 100%; } .col-xs-pull-11 { right: 91.66666667%; } .col-xs-pull-10 { right: 83.33333333%; } .col-xs-pull-9 { right: 75%; } .col-xs-pull-8 { right: 66.66666667%; } .col-xs-pull-7 { right: 58.33333333%; } .col-xs-pull-6 { right: 50%; } .col-xs-pull-5 { right: 41.66666667%; } .col-xs-pull-4 { right: 33.33333333%; } .col-xs-pull-3 { right: 25%; } .col-xs-pull-2 { right: 16.66666667%; } .col-xs-pull-1 { right: 8.33333333%; } .col-xs-pull-0 { right: auto; } .col-xs-push-12 { left: 100%; } .col-xs-push-11 { left: 91.66666667%; } .col-xs-push-10 { left: 83.33333333%; } .col-xs-push-9 { left: 75%; } .col-xs-push-8 { left: 66.66666667%; } .col-xs-push-7 { left: 58.33333333%; } .col-xs-push-6 { left: 50%; } .col-xs-push-5 { left: 41.66666667%; } .col-xs-push-4 { left: 33.33333333%; } .col-xs-push-3 { left: 25%; } .col-xs-push-2 { left: 16.66666667%; } .col-xs-push-1 { left: 8.33333333%; } .col-xs-push-0 { left: auto; } .col-xs-offset-12 { margin-left: 100%; } .col-xs-offset-11 { margin-left: 91.66666667%; } .col-xs-offset-10 { margin-left: 83.33333333%; } .col-xs-offset-9 { margin-left: 75%; } .col-xs-offset-8 { margin-left: 66.66666667%; } .col-xs-offset-7 { margin-left: 58.33333333%; } .col-xs-offset-6 { margin-left: 50%; } .col-xs-offset-5 { margin-left: 41.66666667%; } .col-xs-offset-4 { margin-left: 33.33333333%; } .col-xs-offset-3 { margin-left: 25%; } .col-xs-offset-2 { margin-left: 16.66666667%; } .col-xs-offset-1 { margin-left: 8.33333333%; } .col-xs-offset-0 { margin-left: 0; } @media (min-width: 768px) { .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { float: left; } .col-sm-12 { width: 100%; } .col-sm-11 { width: 91.66666667%; } .col-sm-10 { width: 83.33333333%; } .col-sm-9 { width: 75%; } .col-sm-8 { width: 66.66666667%; } .col-sm-7 { width: 58.33333333%; } .col-sm-6 { width: 50%; } .col-sm-5 { width: 41.66666667%; } .col-sm-4 { width: 33.33333333%; } .col-sm-3 { width: 25%; } .col-sm-2 { width: 16.66666667%; } .col-sm-1 { width: 8.33333333%; } .col-sm-pull-12 { right: 100%; } .col-sm-pull-11 { right: 91.66666667%; } .col-sm-pull-10 { right: 83.33333333%; } .col-sm-pull-9 { right: 75%; } .col-sm-pull-8 { right: 66.66666667%; } .col-sm-pull-7 { right: 58.33333333%; } .col-sm-pull-6 { right: 50%; } .col-sm-pull-5 { right: 41.66666667%; } .col-sm-pull-4 { right: 33.33333333%; } .col-sm-pull-3 { right: 25%; } .col-sm-pull-2 { right: 16.66666667%; } .col-sm-pull-1 { right: 8.33333333%; } .col-sm-pull-0 { right: auto; } .col-sm-push-12 { left: 100%; } .col-sm-push-11 { left: 91.66666667%; } .col-sm-push-10 { left: 83.33333333%; } .col-sm-push-9 { left: 75%; } .col-sm-push-8 { left: 66.66666667%; } .col-sm-push-7 { left: 58.33333333%; } .col-sm-push-6 { left: 50%; } .col-sm-push-5 { left: 41.66666667%; } .col-sm-push-4 { left: 33.33333333%; } .col-sm-push-3 { left: 25%; } .col-sm-push-2 { left: 16.66666667%; } .col-sm-push-1 { left: 8.33333333%; } .col-sm-push-0 { left: auto; } .col-sm-offset-12 { margin-left: 100%; } .col-sm-offset-11 { margin-left: 91.66666667%; } .col-sm-offset-10 { margin-left: 83.33333333%; } .col-sm-offset-9 { margin-left: 75%; } .col-sm-offset-8 { margin-left: 66.66666667%; } .col-sm-offset-7 { margin-left: 58.33333333%; } .col-sm-offset-6 { margin-left: 50%; } .col-sm-offset-5 { margin-left: 41.66666667%; } .col-sm-offset-4 { margin-left: 33.33333333%; } .col-sm-offset-3 { margin-left: 25%; } .col-sm-offset-2 { margin-left: 16.66666667%; } .col-sm-offset-1 { margin-left: 8.33333333%; } .col-sm-offset-0 { margin-left: 0; } } @media (min-width: 992px) { .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { float: left; } .col-md-12 { width: 100%; } .col-md-11 { width: 91.66666667%; } .col-md-10 { width: 83.33333333%; } .col-md-9 { width: 75%; } .col-md-8 { width: 66.66666667%; } .col-md-7 { width: 58.33333333%; } .col-md-6 { width: 50%; } .col-md-5 { width: 41.66666667%; } .col-md-4 { width: 33.33333333%; } .col-md-3 { width: 25%; } .col-md-2 { width: 16.66666667%; } .col-md-1 { width: 8.33333333%; } .col-md-pull-12 { right: 100%; } .col-md-pull-11 { right: 91.66666667%; } .col-md-pull-10 { right: 83.33333333%; } .col-md-pull-9 { right: 75%; } .col-md-pull-8 { right: 66.66666667%; } .col-md-pull-7 { right: 58.33333333%; } .col-md-pull-6 { right: 50%; } .col-md-pull-5 { right: 41.66666667%; } .col-md-pull-4 { right: 33.33333333%; } .col-md-pull-3 { right: 25%; } .col-md-pull-2 { right: 16.66666667%; } .col-md-pull-1 { right: 8.33333333%; } .col-md-pull-0 { right: auto; } .col-md-push-12 { left: 100%; } .col-md-push-11 { left: 91.66666667%; } .col-md-push-10 { left: 83.33333333%; } .col-md-push-9 { left: 75%; } .col-md-push-8 { left: 66.66666667%; } .col-md-push-7 { left: 58.33333333%; } .col-md-push-6 { left: 50%; } .col-md-push-5 { left: 41.66666667%; } .col-md-push-4 { left: 33.33333333%; } .col-md-push-3 { left: 25%; } .col-md-push-2 { left: 16.66666667%; } .col-md-push-1 { left: 8.33333333%; } .col-md-push-0 { left: auto; } .col-md-offset-12 { margin-left: 100%; } .col-md-offset-11 { margin-left: 91.66666667%; } .col-md-offset-10 { margin-left: 83.33333333%; } .col-md-offset-9 { margin-left: 75%; } .col-md-offset-8 { margin-left: 66.66666667%; } .col-md-offset-7 { margin-left: 58.33333333%; } .col-md-offset-6 { margin-left: 50%; } .col-md-offset-5 { margin-left: 41.66666667%; } .col-md-offset-4 { margin-left: 33.33333333%; } .col-md-offset-3 { margin-left: 25%; } .col-md-offset-2 { margin-left: 16.66666667%; } .col-md-offset-1 { margin-left: 8.33333333%; } .col-md-offset-0 { margin-left: 0; } } @media (min-width: 1200px) { .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { float: left; } .col-lg-12 { width: 100%; } .col-lg-11 { width: 91.66666667%; } .col-lg-10 { width: 83.33333333%; } .col-lg-9 { width: 75%; } .col-lg-8 { width: 66.66666667%; } .col-lg-7 { width: 58.33333333%; } .col-lg-6 { width: 50%; } .col-lg-5 { width: 41.66666667%; } .col-lg-4 { width: 33.33333333%; } .col-lg-3 { width: 25%; } .col-lg-2 { width: 16.66666667%; } .col-lg-1 { width: 8.33333333%; } .col-lg-pull-12 { right: 100%; } .col-lg-pull-11 { right: 91.66666667%; } .col-lg-pull-10 { right: 83.33333333%; } .col-lg-pull-9 { right: 75%; } .col-lg-pull-8 { right: 66.66666667%; } .col-lg-pull-7 { right: 58.33333333%; } .col-lg-pull-6 { right: 50%; } .col-lg-pull-5 { right: 41.66666667%; } .col-lg-pull-4 { right: 33.33333333%; } .col-lg-pull-3 { right: 25%; } .col-lg-pull-2 { right: 16.66666667%; } .col-lg-pull-1 { right: 8.33333333%; } .col-lg-pull-0 { right: auto; } .col-lg-push-12 { left: 100%; } .col-lg-push-11 { left: 91.66666667%; } .col-lg-push-10 { left: 83.33333333%; } .col-lg-push-9 { left: 75%; } .col-lg-push-8 { left: 66.66666667%; } .col-lg-push-7 { left: 58.33333333%; } .col-lg-push-6 { left: 50%; } .col-lg-push-5 { left: 41.66666667%; } .col-lg-push-4 { left: 33.33333333%; } .col-lg-push-3 { left: 25%; } .col-lg-push-2 { left: 16.66666667%; } .col-lg-push-1 { left: 8.33333333%; } .col-lg-push-0 { left: auto; } .col-lg-offset-12 { margin-left: 100%; } .col-lg-offset-11 { margin-left: 91.66666667%; } .col-lg-offset-10 { margin-left: 83.33333333%; } .col-lg-offset-9 { margin-left: 75%; } .col-lg-offset-8 { margin-left: 66.66666667%; } .col-lg-offset-7 { margin-left: 58.33333333%; } .col-lg-offset-6 { margin-left: 50%; } .col-lg-offset-5 { margin-left: 41.66666667%; } .col-lg-offset-4 { margin-left: 33.33333333%; } .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-2 { margin-left: 16.66666667%; } .col-lg-offset-1 { margin-left: 8.33333333%; } .col-lg-offset-0 { margin-left: 0; } } table { background-color: transparent; } caption { padding-top: 8px; padding-bottom: 8px; color: #777; text-align: left; } th { text-align: left; } .table { width: 100%; max-width: 100%; margin-bottom: 20px; } .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd; } .table > thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #ddd; } .table > caption + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > th, .table > thead:first-child > tr:first-child > th, .table > caption + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > td, .table > thead:first-child > tr:first-child > td { border-top: 0; } .table > tbody + tbody { border-top: 2px solid #ddd; } .table .table { background-color: #fff; } .table-condensed > thead > tr > th, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > td { padding: 5px; } .table-bordered { border: 1px solid #ddd; } .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { border: 1px solid #ddd; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 2px; } .table-striped > tbody > tr:nth-of-type(odd) { background-color: #f9f9f9; } .table-hover > tbody > tr:hover { background-color: #f5f5f5; } table col[class*="col-"] { position: static; display: table-column; float: none; } table td[class*="col-"], table th[class*="col-"] { position: static; display: table-cell; float: none; } .table > thead > tr > td.active, .table > tbody > tr > td.active, .table > tfoot > tr > td.active, .table > thead > tr > th.active, .table > tbody > tr > th.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td, .table > tbody > tr.active > td, .table > tfoot > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr.active > th, .table > tfoot > tr.active > th { background-color: #f5f5f5; } .table-hover > tbody > tr > td.active:hover, .table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, .table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th { background-color: #e8e8e8; } .table > thead > tr > td.success, .table > tbody > tr > td.success, .table > tfoot > tr > td.success, .table > thead > tr > th.success, .table > tbody > tr > th.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td, .table > tbody > tr.success > td, .table > tfoot > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr.success > th, .table > tfoot > tr.success > th { background-color: #dff0d8; } .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th { background-color: #d0e9c6; } .table > thead > tr > td.info, .table > tbody > tr > td.info, .table > tfoot > tr > td.info, .table > thead > tr > th.info, .table > tbody > tr > th.info, .table > tfoot > tr > th.info, .table > thead > tr.info > td, .table > tbody > tr.info > td, .table > tfoot > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr.info > th, .table > tfoot > tr.info > th { background-color: #d9edf7; } .table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th { background-color: #c4e3f3; } .table > thead > tr > td.warning, .table > tbody > tr > td.warning, .table > tfoot > tr > td.warning, .table > thead > tr > th.warning, .table > tbody > tr > th.warning, .table > tfoot > tr > th.warning, .table > thead > tr.warning > td, .table > tbody > tr.warning > td, .table > tfoot > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr.warning > th, .table > tfoot > tr.warning > th { background-color: #fcf8e3; } .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th { background-color: #faf2cc; } .table > thead > tr > td.danger, .table > tbody > tr > td.danger, .table > tfoot > tr > td.danger, .table > thead > tr > th.danger, .table > tbody > tr > th.danger, .table > tfoot > tr > th.danger, .table > thead > tr.danger > td, .table > tbody > tr.danger > td, .table > tfoot > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr.danger > th, .table > tfoot > tr.danger > th { background-color: #f2dede; } .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th { background-color: #ebcccc; } .table-responsive { min-height: .01%; overflow-x: auto; } @media screen and (max-width: 767px) { .table-responsive { width: 100%; margin-bottom: 15px; overflow-y: hidden; -ms-overflow-style: -ms-autohiding-scrollbar; border: 1px solid #ddd; } .table-responsive > .table { margin-bottom: 0; } .table-responsive > .table > thead > tr > th, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tfoot > tr > td { white-space: nowrap; } .table-responsive > .table-bordered { border: 0; } .table-responsive > .table-bordered > thead > tr > th:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .table-responsive > .table-bordered > thead > tr > th:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > th, .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > td { border-bottom: 0; } } fieldset { min-width: 0; padding: 0; margin: 0; border: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 20px; font-size: 21px; line-height: inherit; color: #333; border: 0; border-bottom: 1px solid #e5e5e5; } label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: bold; } input[type="search"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; margin-top: 1px \9; line-height: normal; } input[type="file"] { display: block; } input[type="range"] { display: block; width: 100%; } select[multiple], select[size] { height: auto; } input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } output { display: block; padding-top: 7px; font-size: 14px; line-height: 1.42857143; color: #555; } .form-control { display: block; width: 100%; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } .form-control:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); } .form-control::-moz-placeholder { color: #999; opacity: 1; } .form-control:-ms-input-placeholder { color: #999; } .form-control::-webkit-input-placeholder { color: #999; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { background-color: #eee; opacity: 1; } .form-control[disabled], fieldset[disabled] .form-control { cursor: not-allowed; } textarea.form-control { height: auto; } input[type="search"] { -webkit-appearance: none; } @media screen and (-webkit-min-device-pixel-ratio: 0) { input[type="date"].form-control, input[type="time"].form-control, input[type="datetime-local"].form-control, input[type="month"].form-control { line-height: 34px; } input[type="date"].input-sm, input[type="time"].input-sm, input[type="datetime-local"].input-sm, input[type="month"].input-sm, .input-group-sm input[type="date"], .input-group-sm input[type="time"], .input-group-sm input[type="datetime-local"], .input-group-sm input[type="month"] { line-height: 30px; } input[type="date"].input-lg, input[type="time"].input-lg, input[type="datetime-local"].input-lg, input[type="month"].input-lg, .input-group-lg input[type="date"], .input-group-lg input[type="time"], .input-group-lg input[type="datetime-local"], .input-group-lg input[type="month"] { line-height: 46px; } } .form-group { margin-bottom: 15px; } .radio, .checkbox { position: relative; display: block; margin-top: 10px; margin-bottom: 10px; } .radio label, .checkbox label { min-height: 20px; padding-left: 20px; margin-bottom: 0; font-weight: normal; cursor: pointer; } .radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { position: absolute; margin-top: 4px \9; margin-left: -20px; } .radio + .radio, .checkbox + .checkbox { margin-top: -5px; } .radio-inline, .checkbox-inline { position: relative; display: inline-block; padding-left: 20px; margin-bottom: 0; font-weight: normal; vertical-align: middle; cursor: pointer; } .radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline { margin-top: 0; margin-left: 10px; } input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"].disabled, input[type="checkbox"].disabled, fieldset[disabled] input[type="radio"], fieldset[disabled] input[type="checkbox"] { cursor: not-allowed; } .radio-inline.disabled, .checkbox-inline.disabled, fieldset[disabled] .radio-inline, fieldset[disabled] .checkbox-inline { cursor: not-allowed; } .radio.disabled label, .checkbox.disabled label, fieldset[disabled] .radio label, fieldset[disabled] .checkbox label { cursor: not-allowed; } .form-control-static { min-height: 34px; padding-top: 7px; padding-bottom: 7px; margin-bottom: 0; } .form-control-static.input-lg, .form-control-static.input-sm { padding-right: 0; padding-left: 0; } .input-sm { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-sm { height: 30px; line-height: 30px; } textarea.input-sm, select[multiple].input-sm { height: auto; } .form-group-sm .form-control { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .form-group-sm select.form-control { height: 30px; line-height: 30px; } .form-group-sm textarea.form-control, .form-group-sm select[multiple].form-control { height: auto; } .form-group-sm .form-control-static { height: 30px; min-height: 32px; padding: 6px 10px; font-size: 12px; line-height: 1.5; } .input-lg { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } select.input-lg { height: 46px; line-height: 46px; } textarea.input-lg, select[multiple].input-lg { height: auto; } .form-group-lg .form-control { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } .form-group-lg select.form-control { height: 46px; line-height: 46px; } .form-group-lg textarea.form-control, .form-group-lg select[multiple].form-control { height: auto; } .form-group-lg .form-control-static { height: 46px; min-height: 38px; padding: 11px 16px; font-size: 18px; line-height: 1.3333333; } .has-feedback { position: relative; } .has-feedback .form-control { padding-right: 42.5px; } .form-control-feedback { position: absolute; top: 0; right: 0; z-index: 2; display: block; width: 34px; height: 34px; line-height: 34px; text-align: center; pointer-events: none; } .input-lg + .form-control-feedback, .input-group-lg + .form-control-feedback, .form-group-lg .form-control + .form-control-feedback { width: 46px; height: 46px; line-height: 46px; } .input-sm + .form-control-feedback, .input-group-sm + .form-control-feedback, .form-group-sm .form-control + .form-control-feedback { width: 30px; height: 30px; line-height: 30px; } .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline, .has-success.radio label, .has-success.checkbox label, .has-success.radio-inline label, .has-success.checkbox-inline label { color: #3c763d; } .has-success .form-control { border-color: #3c763d; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-success .form-control:focus { border-color: #2b542c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; } .has-success .input-group-addon { color: #3c763d; background-color: #dff0d8; border-color: #3c763d; } .has-success .form-control-feedback { color: #3c763d; } .has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline, .has-warning.radio label, .has-warning.checkbox label, .has-warning.radio-inline label, .has-warning.checkbox-inline label { color: #8a6d3b; } .has-warning .form-control { border-color: #8a6d3b; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-warning .form-control:focus { border-color: #66512c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; } .has-warning .input-group-addon { color: #8a6d3b; background-color: #fcf8e3; border-color: #8a6d3b; } .has-warning .form-control-feedback { color: #8a6d3b; } .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline, .has-error.radio label, .has-error.checkbox label, .has-error.radio-inline label, .has-error.checkbox-inline label { color: #a94442; } .has-error .form-control { border-color: #a94442; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-error .form-control:focus { border-color: #843534; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; } .has-error .input-group-addon { color: #a94442; background-color: #f2dede; border-color: #a94442; } .has-error .form-control-feedback { color: #a94442; } .has-feedback label ~ .form-control-feedback { top: 25px; } .has-feedback label.sr-only ~ .form-control-feedback { top: 0; } .help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; } @media (min-width: 768px) { .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; } .form-inline .form-control-static { display: inline-block; } .form-inline .input-group { display: inline-table; vertical-align: middle; } .form-inline .input-group .input-group-addon, .form-inline .input-group .input-group-btn, .form-inline .input-group .form-control { width: auto; } .form-inline .input-group > .form-control { width: 100%; } .form-inline .control-label { margin-bottom: 0; vertical-align: middle; } .form-inline .radio, .form-inline .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .form-inline .radio label, .form-inline .checkbox label { padding-left: 0; } .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .form-inline .has-feedback .form-control-feedback { top: 0; } } .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline { padding-top: 7px; margin-top: 0; margin-bottom: 0; } .form-horizontal .radio, .form-horizontal .checkbox { min-height: 27px; } .form-horizontal .form-group { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { .form-horizontal .control-label { padding-top: 7px; margin-bottom: 0; text-align: right; } } .form-horizontal .has-feedback .form-control-feedback { right: 15px; } @media (min-width: 768px) { .form-horizontal .form-group-lg .control-label { padding-top: 14.333333px; font-size: 18px; } } @media (min-width: 768px) { .form-horizontal .form-group-sm .control-label { padding-top: 6px; font-size: 12px; } } .btn { display: inline-block; padding: 6px 12px; margin-bottom: 0; font-size: 14px; font-weight: normal; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-radius: 4px; } .btn:focus, .btn:active:focus, .btn.active:focus, .btn.focus, .btn:active.focus, .btn.active.focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn:hover, .btn:focus, .btn.focus { color: #333; text-decoration: none; } .btn:active, .btn.active { background-image: none; outline: 0; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); } .btn.disabled, .btn[disabled], fieldset[disabled] .btn { cursor: not-allowed; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; opacity: .65; } a.btn.disabled, fieldset[disabled] a.btn { pointer-events: none; } .btn-default { color: #333; background-color: #fff; border-color: #ccc; } .btn-default:focus, .btn-default.focus { color: #333; background-color: #e6e6e6; border-color: #8c8c8c; } .btn-default:hover { color: #333; background-color: #e6e6e6; border-color: #adadad; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { color: #333; background-color: #e6e6e6; border-color: #adadad; } .btn-default:active:hover, .btn-default.active:hover, .open > .dropdown-toggle.btn-default:hover, .btn-default:active:focus, .btn-default.active:focus, .open > .dropdown-toggle.btn-default:focus, .btn-default:active.focus, .btn-default.active.focus, .open > .dropdown-toggle.btn-default.focus { color: #333; background-color: #d4d4d4; border-color: #8c8c8c; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { background-image: none; } .btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active { background-color: #fff; border-color: #ccc; } .btn-default .badge { color: #fff; background-color: #333; } .btn-primary { color: #fff; background-color: #337ab7; border-color: #2e6da4; } .btn-primary:focus, .btn-primary.focus { color: #fff; background-color: #286090; border-color: #122b40; } .btn-primary:hover { color: #fff; background-color: #286090; border-color: #204d74; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { color: #fff; background-color: #286090; border-color: #204d74; } .btn-primary:active:hover, .btn-primary.active:hover, .open > .dropdown-toggle.btn-primary:hover, .btn-primary:active:focus, .btn-primary.active:focus, .open > .dropdown-toggle.btn-primary:focus, .btn-primary:active.focus, .btn-primary.active.focus, .open > .dropdown-toggle.btn-primary.focus { color: #fff; background-color: #204d74; border-color: #122b40; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { background-color: #337ab7; border-color: #2e6da4; } .btn-primary .badge { color: #337ab7; background-color: #fff; } .btn-success { color: #fff; background-color: #5cb85c; border-color: #4cae4c; } .btn-success:focus, .btn-success.focus { color: #fff; background-color: #449d44; border-color: #255625; } .btn-success:hover { color: #fff; background-color: #449d44; border-color: #398439; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { color: #fff; background-color: #449d44; border-color: #398439; } .btn-success:active:hover, .btn-success.active:hover, .open > .dropdown-toggle.btn-success:hover, .btn-success:active:focus, .btn-success.active:focus, .open > .dropdown-toggle.btn-success:focus, .btn-success:active.focus, .btn-success.active.focus, .open > .dropdown-toggle.btn-success.focus { color: #fff; background-color: #398439; border-color: #255625; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { background-image: none; } .btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled.focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success.focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active { background-color: #5cb85c; border-color: #4cae4c; } .btn-success .badge { color: #5cb85c; background-color: #fff; } .btn-info { color: #fff; background-color: #5bc0de; border-color: #46b8da; } .btn-info:focus, .btn-info.focus { color: #fff; background-color: #31b0d5; border-color: #1b6d85; } .btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #269abc; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { color: #fff; background-color: #31b0d5; border-color: #269abc; } .btn-info:active:hover, .btn-info.active:hover, .open > .dropdown-toggle.btn-info:hover, .btn-info:active:focus, .btn-info.active:focus, .open > .dropdown-toggle.btn-info:focus, .btn-info:active.focus, .btn-info.active.focus, .open > .dropdown-toggle.btn-info.focus { color: #fff; background-color: #269abc; border-color: #1b6d85; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { background-image: none; } .btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled.focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info.focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active { background-color: #5bc0de; border-color: #46b8da; } .btn-info .badge { color: #5bc0de; background-color: #fff; } .btn-warning { color: #fff; background-color: #f0ad4e; border-color: #eea236; } .btn-warning:focus, .btn-warning.focus { color: #fff; background-color: #ec971f; border-color: #985f0d; } .btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #d58512; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { color: #fff; background-color: #ec971f; border-color: #d58512; } .btn-warning:active:hover, .btn-warning.active:hover, .open > .dropdown-toggle.btn-warning:hover, .btn-warning:active:focus, .btn-warning.active:focus, .open > .dropdown-toggle.btn-warning:focus, .btn-warning:active.focus, .btn-warning.active.focus, .open > .dropdown-toggle.btn-warning.focus { color: #fff; background-color: #d58512; border-color: #985f0d; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { background-image: none; } .btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled.focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning.focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active { background-color: #f0ad4e; border-color: #eea236; } .btn-warning .badge { color: #f0ad4e; background-color: #fff; } .btn-danger { color: #fff; background-color: #d9534f; border-color: #d43f3a; } .btn-danger:focus, .btn-danger.focus { color: #fff; background-color: #c9302c; border-color: #761c19; } .btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #ac2925; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { color: #fff; background-color: #c9302c; border-color: #ac2925; } .btn-danger:active:hover, .btn-danger.active:hover, .open > .dropdown-toggle.btn-danger:hover, .btn-danger:active:focus, .btn-danger.active:focus, .open > .dropdown-toggle.btn-danger:focus, .btn-danger:active.focus, .btn-danger.active.focus, .open > .dropdown-toggle.btn-danger.focus { color: #fff; background-color: #ac2925; border-color: #761c19; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { background-image: none; } .btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled.focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger.focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active { background-color: #d9534f; border-color: #d43f3a; } .btn-danger .badge { color: #d9534f; background-color: #fff; } .btn-link { font-weight: normal; color: #337ab7; border-radius: 0; } .btn-link, .btn-link:active, .btn-link.active, .btn-link[disabled], fieldset[disabled] .btn-link { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active { border-color: transparent; } .btn-link:hover, .btn-link:focus { color: #23527c; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, fieldset[disabled] .btn-link:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:focus { color: #777; text-decoration: none; } .btn-lg, .btn-group-lg > .btn { padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } .btn-sm, .btn-group-sm > .btn { padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-xs, .btn-group-xs > .btn { padding: 1px 5px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-block { display: block; width: 100%; } .btn-block + .btn-block { margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { width: 100%; } .fade { opacity: 0; -webkit-transition: opacity .15s linear; -o-transition: opacity .15s linear; transition: opacity .15s linear; } .fade.in { opacity: 1; } .collapse { display: none; } .collapse.in { display: block; } tr.collapse.in { display: table-row; } tbody.collapse.in { display: table-row-group; } .collapsing { position: relative; height: 0; overflow: hidden; -webkit-transition-timing-function: ease; -o-transition-timing-function: ease; transition-timing-function: ease; -webkit-transition-duration: .35s; -o-transition-duration: .35s; transition-duration: .35s; -webkit-transition-property: height, visibility; -o-transition-property: height, visibility; transition-property: height, visibility; } .caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px dashed; border-top: 4px solid \9; border-right: 4px solid transparent; border-left: 4px solid transparent; } .dropup, .dropdown { position: relative; } .dropdown-toggle:focus { outline: 0; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; font-size: 14px; text-align: left; list-style: none; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, .15); border-radius: 4px; -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); box-shadow: 0 6px 12px rgba(0, 0, 0, .175); } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.42857143; color: #333; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { color: #262626; text-decoration: none; background-color: #f5f5f5; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #fff; text-decoration: none; background-color: #337ab7; outline: 0; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #777; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { text-decoration: none; cursor: not-allowed; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .open > .dropdown-menu { display: block; } .open > a { outline: 0; } .dropdown-menu-right { right: 0; left: auto; } .dropdown-menu-left { right: auto; left: 0; } .dropdown-header { display: block; padding: 3px 20px; font-size: 12px; line-height: 1.42857143; color: #777; white-space: nowrap; } .dropdown-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 990; } .pull-right > .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { content: ""; border-top: 0; border-bottom: 4px dashed; border-bottom: 4px solid \9; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 2px; } @media (min-width: 768px) { .navbar-right .dropdown-menu { right: 0; left: auto; } .navbar-right .dropdown-menu-left { right: auto; left: 0; } } .btn-group, .btn-group-vertical { position: relative; display: inline-block; vertical-align: middle; } .btn-group > .btn, .btn-group-vertical > .btn { position: relative; float: left; } .btn-group > .btn:hover, .btn-group-vertical > .btn:hover, .btn-group > .btn:focus, .btn-group-vertical > .btn:focus, .btn-group > .btn:active, .btn-group-vertical > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn.active { z-index: 2; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group { margin-left: -1px; } .btn-toolbar { margin-left: -5px; } .btn-toolbar .btn, .btn-toolbar .btn-group, .btn-toolbar .input-group { float: left; } .btn-toolbar > .btn, .btn-toolbar > .btn-group, .btn-toolbar > .input-group { margin-left: 5px; } .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { border-radius: 0; } .btn-group > .btn:first-child { margin-left: 0; } .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { border-top-right-radius: 0; border-bottom-right-radius: 0; } .btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; } .btn-group > .btn-group { float: left; } .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-top-right-radius: 0; border-bottom-right-radius: 0; } .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { border-top-left-radius: 0; border-bottom-left-radius: 0; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group > .btn + .dropdown-toggle { padding-right: 8px; padding-left: 8px; } .btn-group > .btn-lg + .dropdown-toggle { padding-right: 12px; padding-left: 12px; } .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); } .btn-group.open .dropdown-toggle.btn-link { -webkit-box-shadow: none; box-shadow: none; } .btn .caret { margin-left: 0; } .btn-lg .caret { border-width: 5px 5px 0; border-bottom-width: 0; } .dropup .btn-lg .caret { border-width: 0 5px 5px; } .btn-group-vertical > .btn, .btn-group-vertical > .btn-group, .btn-group-vertical > .btn-group > .btn { display: block; float: none; width: 100%; max-width: 100%; } .btn-group-vertical > .btn-group > .btn { float: none; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } .btn-group-vertical > .btn:not(:first-child):not(:last-child) { border-radius: 0; } .btn-group-vertical > .btn:first-child:not(:last-child) { border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:last-child:not(:first-child) { border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-left-radius: 4px; } .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { border-top-left-radius: 0; border-top-right-radius: 0; } .btn-group-justified { display: table; width: 100%; table-layout: fixed; border-collapse: separate; } .btn-group-justified > .btn, .btn-group-justified > .btn-group { display: table-cell; float: none; width: 1%; } .btn-group-justified > .btn-group .btn { width: 100%; } .btn-group-justified > .btn-group .dropdown-menu { left: auto; } [data-toggle="buttons"] > .btn input[type="radio"], [data-toggle="buttons"] > .btn-group > .btn input[type="radio"], [data-toggle="buttons"] > .btn input[type="checkbox"], [data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { position: absolute; clip: rect(0, 0, 0, 0); pointer-events: none; } .input-group { position: relative; display: table; border-collapse: separate; } .input-group[class*="col-"] { float: none; padding-right: 0; padding-left: 0; } .input-group .form-control { position: relative; z-index: 2; float: left; width: 100%; margin-bottom: 0; } .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } select.input-group-lg > .form-control, select.input-group-lg > .input-group-addon, select.input-group-lg > .input-group-btn > .btn { height: 46px; line-height: 46px; } textarea.input-group-lg > .form-control, textarea.input-group-lg > .input-group-addon, textarea.input-group-lg > .input-group-btn > .btn, select[multiple].input-group-lg > .form-control, select[multiple].input-group-lg > .input-group-addon, select[multiple].input-group-lg > .input-group-btn > .btn { height: auto; } .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-group-sm > .form-control, select.input-group-sm > .input-group-addon, select.input-group-sm > .input-group-btn > .btn { height: 30px; line-height: 30px; } textarea.input-group-sm > .form-control, textarea.input-group-sm > .input-group-addon, textarea.input-group-sm > .input-group-btn > .btn, select[multiple].input-group-sm > .form-control, select[multiple].input-group-sm > .input-group-addon, select[multiple].input-group-sm > .input-group-btn > .btn { height: auto; } .input-group-addon, .input-group-btn, .input-group .form-control { display: table-cell; } .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child), .input-group .form-control:not(:first-child):not(:last-child) { border-radius: 0; } .input-group-addon, .input-group-btn { width: 1%; white-space: nowrap; vertical-align: middle; } .input-group-addon { padding: 6px 12px; font-size: 14px; font-weight: normal; line-height: 1; color: #555; text-align: center; background-color: #eee; border: 1px solid #ccc; border-radius: 4px; } .input-group-addon.input-sm { padding: 5px 10px; font-size: 12px; border-radius: 3px; } .input-group-addon.input-lg { padding: 10px 16px; font-size: 18px; border-radius: 6px; } .input-group-addon input[type="radio"], .input-group-addon input[type="checkbox"] { margin-top: 0; } .input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; } .input-group-addon:first-child { border-right: 0; } .input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child), .input-group-btn:first-child > .btn-group:not(:first-child) > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; } .input-group-addon:last-child { border-left: 0; } .input-group-btn { position: relative; font-size: 0; white-space: nowrap; } .input-group-btn > .btn { position: relative; } .input-group-btn > .btn + .btn { margin-left: -1px; } .input-group-btn > .btn:hover, .input-group-btn > .btn:focus, .input-group-btn > .btn:active { z-index: 2; } .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group { margin-right: -1px; } .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group { z-index: 2; margin-left: -1px; } .nav { padding-left: 0; margin-bottom: 0; list-style: none; } .nav > li { position: relative; display: block; } .nav > li > a { position: relative; display: block; padding: 10px 15px; } .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; background-color: #eee; } .nav > li.disabled > a { color: #777; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { color: #777; text-decoration: none; cursor: not-allowed; background-color: transparent; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background-color: #eee; border-color: #337ab7; } .nav .nav-divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .nav > li > a > img { max-width: none; } .nav-tabs { border-bottom: 1px solid #ddd; } .nav-tabs > li { float: left; margin-bottom: -1px; } .nav-tabs > li > a { margin-right: 2px; line-height: 1.42857143; border: 1px solid transparent; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { border-color: #eee #eee #ddd; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #555; cursor: default; background-color: #fff; border: 1px solid #ddd; border-bottom-color: transparent; } .nav-tabs.nav-justified { width: 100%; border-bottom: 0; } .nav-tabs.nav-justified > li { float: none; } .nav-tabs.nav-justified > li > a { margin-bottom: 5px; text-align: center; } .nav-tabs.nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-tabs.nav-justified > li { display: table-cell; width: 1%; } .nav-tabs.nav-justified > li > a { margin-bottom: 0; } } .nav-tabs.nav-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border: 1px solid #ddd; } @media (min-width: 768px) { .nav-tabs.nav-justified > li > a { border-bottom: 1px solid #ddd; border-radius: 4px 4px 0 0; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border-bottom-color: #fff; } } .nav-pills > li { float: left; } .nav-pills > li > a { border-radius: 4px; } .nav-pills > li + li { margin-left: 2px; } .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #fff; background-color: #337ab7; } .nav-stacked > li { float: none; } .nav-stacked > li + li { margin-top: 2px; margin-left: 0; } .nav-justified { width: 100%; } .nav-justified > li { float: none; } .nav-justified > li > a { margin-bottom: 5px; text-align: center; } .nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-justified > li { display: table-cell; width: 1%; } .nav-justified > li > a { margin-bottom: 0; } } .nav-tabs-justified { border-bottom: 0; } .nav-tabs-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border: 1px solid #ddd; } @media (min-width: 768px) { .nav-tabs-justified > li > a { border-bottom: 1px solid #ddd; border-radius: 4px 4px 0 0; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border-bottom-color: #fff; } } .tab-content > .tab-pane { display: none; } .tab-content > .active { display: block; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-left-radius: 0; border-top-right-radius: 0; } .navbar { position: relative; min-height: 50px; margin-bottom: 20px; border: 1px solid transparent; } @media (min-width: 768px) { .navbar { border-radius: 4px; } } @media (min-width: 768px) { .navbar-header { float: left; } } .navbar-collapse { padding-right: 15px; padding-left: 15px; overflow-x: visible; -webkit-overflow-scrolling: touch; border-top: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); } .navbar-collapse.in { overflow-y: auto; } @media (min-width: 768px) { .navbar-collapse { width: auto; border-top: 0; -webkit-box-shadow: none; box-shadow: none; } .navbar-collapse.collapse { display: block !important; height: auto !important; padding-bottom: 0; overflow: visible !important; } .navbar-collapse.in { overflow-y: visible; } .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { padding-right: 0; padding-left: 0; } } .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 340px; } @media (max-device-width: 480px) and (orientation: landscape) { .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 200px; } } .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: 0; margin-left: 0; } } .navbar-static-top { z-index: 1000; border-width: 0 0 1px; } @media (min-width: 768px) { .navbar-static-top { border-radius: 0; } } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; } @media (min-width: 768px) { .navbar-fixed-top, .navbar-fixed-bottom { border-radius: 0; } } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-fixed-bottom { bottom: 0; margin-bottom: 0; border-width: 1px 0 0; } .navbar-brand { float: left; height: 50px; padding: 15px 15px; font-size: 18px; line-height: 20px; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } .navbar-brand > img { display: block; } @media (min-width: 768px) { .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { margin-left: -15px; } } .navbar-toggle { position: relative; float: right; padding: 9px 10px; margin-top: 8px; margin-right: 15px; margin-bottom: 8px; background-color: transparent; background-image: none; border: 1px solid transparent; border-radius: 4px; } .navbar-toggle:focus { outline: 0; } .navbar-toggle .icon-bar { display: block; width: 22px; height: 2px; border-radius: 1px; } .navbar-toggle .icon-bar + .icon-bar { margin-top: 4px; } @media (min-width: 768px) { .navbar-toggle { display: none; } } .navbar-nav { margin: 7.5px -15px; } .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; line-height: 20px; } @media (max-width: 767px) { .navbar-nav .open .dropdown-menu { position: static; float: none; width: auto; margin-top: 0; background-color: transparent; border: 0; -webkit-box-shadow: none; box-shadow: none; } .navbar-nav .open .dropdown-menu > li > a, .navbar-nav .open .dropdown-menu .dropdown-header { padding: 5px 15px 5px 25px; } .navbar-nav .open .dropdown-menu > li > a { line-height: 20px; } .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-nav .open .dropdown-menu > li > a:focus { background-image: none; } } @media (min-width: 768px) { .navbar-nav { float: left; margin: 0; } .navbar-nav > li { float: left; } .navbar-nav > li > a { padding-top: 15px; padding-bottom: 15px; } } .navbar-form { padding: 10px 15px; margin-top: 8px; margin-right: -15px; margin-bottom: 8px; margin-left: -15px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); } @media (min-width: 768px) { .navbar-form .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .navbar-form .form-control { display: inline-block; width: auto; vertical-align: middle; } .navbar-form .form-control-static { display: inline-block; } .navbar-form .input-group { display: inline-table; vertical-align: middle; } .navbar-form .input-group .input-group-addon, .navbar-form .input-group .input-group-btn, .navbar-form .input-group .form-control { width: auto; } .navbar-form .input-group > .form-control { width: 100%; } .navbar-form .control-label { margin-bottom: 0; vertical-align: middle; } .navbar-form .radio, .navbar-form .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .navbar-form .radio label, .navbar-form .checkbox label { padding-left: 0; } .navbar-form .radio input[type="radio"], .navbar-form .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .navbar-form .has-feedback .form-control-feedback { top: 0; } } @media (max-width: 767px) { .navbar-form .form-group { margin-bottom: 5px; } .navbar-form .form-group:last-child { margin-bottom: 0; } } @media (min-width: 768px) { .navbar-form { width: auto; padding-top: 0; padding-bottom: 0; margin-right: 0; margin-left: 0; border: 0; -webkit-box-shadow: none; box-shadow: none; } } .navbar-nav > li > .dropdown-menu { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; } .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { margin-bottom: 0; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .navbar-btn { margin-top: 8px; margin-bottom: 8px; } .navbar-btn.btn-sm { margin-top: 10px; margin-bottom: 10px; } .navbar-btn.btn-xs { margin-top: 14px; margin-bottom: 14px; } .navbar-text { margin-top: 15px; margin-bottom: 15px; } @media (min-width: 768px) { .navbar-text { float: left; margin-right: 15px; margin-left: 15px; } } @media (min-width: 768px) { .navbar-left { float: left !important; } .navbar-right { float: right !important; margin-right: -15px; } .navbar-right ~ .navbar-right { margin-right: 0; } } .navbar-default { background-color: #f8f8f8; border-color: #e7e7e7; } .navbar-default .navbar-brand { color: #777; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #5e5e5e; background-color: transparent; } .navbar-default .navbar-text { color: #777; } .navbar-default .navbar-nav > li > a { color: #777; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #333; background-color: transparent; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color: #555; background-color: #e7e7e7; } .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #ccc; background-color: transparent; } .navbar-default .navbar-toggle { border-color: #ddd; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: #ddd; } .navbar-default .navbar-toggle .icon-bar { background-color: #888; } .navbar-default .navbar-collapse, .navbar-default .navbar-form { border-color: #e7e7e7; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { color: #555; background-color: #e7e7e7; } @media (max-width: 767px) { .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #777; } .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #333; background-color: transparent; } .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { color: #555; background-color: #e7e7e7; } .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #ccc; background-color: transparent; } } .navbar-default .navbar-link { color: #777; } .navbar-default .navbar-link:hover { color: #333; } .navbar-default .btn-link { color: #777; } .navbar-default .btn-link:hover, .navbar-default .btn-link:focus { color: #333; } .navbar-default .btn-link[disabled]:hover, fieldset[disabled] .navbar-default .btn-link:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:focus { color: #ccc; } .navbar-inverse { background-color: #222; border-color: #080808; } .navbar-inverse .navbar-brand { color: #9d9d9d; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-text { color: #9d9d9d; } .navbar-inverse .navbar-nav > li > a { color: #9d9d9d; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #fff; background-color: #080808; } .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { color: #444; background-color: transparent; } .navbar-inverse .navbar-toggle { border-color: #333; } .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { background-color: #333; } .navbar-inverse .navbar-toggle .icon-bar { background-color: #fff; } .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { border-color: #101010; } .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { color: #fff; background-color: #080808; } @media (max-width: 767px) { .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { border-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu .divider { background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #9d9d9d; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { color: #fff; background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #444; background-color: transparent; } } .navbar-inverse .navbar-link { color: #9d9d9d; } .navbar-inverse .navbar-link:hover { color: #fff; } .navbar-inverse .btn-link { color: #9d9d9d; } .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus { color: #fff; } .navbar-inverse .btn-link[disabled]:hover, fieldset[disabled] .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:focus { color: #444; } .breadcrumb { padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #f5f5f5; border-radius: 4px; } .breadcrumb > li { display: inline-block; } .breadcrumb > li + li:before { padding: 0 5px; color: #ccc; content: "/\00a0"; } .breadcrumb > .active { color: #777; } .pagination { display: inline-block; padding-left: 0; margin: 20px 0; border-radius: 4px; } .pagination > li { display: inline; } .pagination > li > a, .pagination > li > span { position: relative; float: left; padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; color: #337ab7; text-decoration: none; background-color: #fff; border: 1px solid #ddd; } .pagination > li:first-child > a, .pagination > li:first-child > span { margin-left: 0; border-top-left-radius: 4px; border-bottom-left-radius: 4px; } .pagination > li:last-child > a, .pagination > li:last-child > span { border-top-right-radius: 4px; border-bottom-right-radius: 4px; } .pagination > li > a:hover, .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { z-index: 3; color: #23527c; background-color: #eee; border-color: #ddd; } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { z-index: 2; color: #fff; cursor: default; background-color: #337ab7; border-color: #337ab7; } .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #777; cursor: not-allowed; background-color: #fff; border-color: #ddd; } .pagination-lg > li > a, .pagination-lg > li > span { padding: 10px 16px; font-size: 18px; line-height: 1.3333333; } .pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } .pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span { border-top-right-radius: 6px; border-bottom-right-radius: 6px; } .pagination-sm > li > a, .pagination-sm > li > span { padding: 5px 10px; font-size: 12px; line-height: 1.5; } .pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span { border-top-left-radius: 3px; border-bottom-left-radius: 3px; } .pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span { border-top-right-radius: 3px; border-bottom-right-radius: 3px; } .pager { padding-left: 0; margin: 20px 0; text-align: center; list-style: none; } .pager li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #fff; border: 1px solid #ddd; border-radius: 15px; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #eee; } .pager .next > a, .pager .next > span { float: right; } .pager .previous > a, .pager .previous > span { float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { color: #777; cursor: not-allowed; background-color: #fff; } .label { display: inline; padding: .2em .6em .3em; font-size: 75%; font-weight: bold; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; } a.label:hover, a.label:focus { color: #fff; text-decoration: none; cursor: pointer; } .label:empty { display: none; } .btn .label { position: relative; top: -1px; } .label-default { background-color: #777; } .label-default[href]:hover, .label-default[href]:focus { background-color: #5e5e5e; } .label-primary { background-color: #337ab7; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #286090; } .label-success { background-color: #5cb85c; } .label-success[href]:hover, .label-success[href]:focus { background-color: #449d44; } .label-info { background-color: #5bc0de; } .label-info[href]:hover, .label-info[href]:focus { background-color: #31b0d5; } .label-warning { background-color: #f0ad4e; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #ec971f; } .label-danger { background-color: #d9534f; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #c9302c; } .badge { display: inline-block; min-width: 10px; padding: 3px 7px; font-size: 12px; font-weight: bold; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: middle; background-color: #777; border-radius: 10px; } .badge:empty { display: none; } .btn .badge { position: relative; top: -1px; } .btn-xs .badge, .btn-group-xs > .btn .badge { top: 0; padding: 1px 5px; } a.badge:hover, a.badge:focus { color: #fff; text-decoration: none; cursor: pointer; } .list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #337ab7; background-color: #fff; } .list-group-item > .badge { float: right; } .list-group-item > .badge + .badge { margin-right: 5px; } .nav-pills > li > a > .badge { margin-left: 3px; } .jumbotron { padding-top: 30px; padding-bottom: 30px; margin-bottom: 30px; color: inherit; background-color: #eee; } .jumbotron h1, .jumbotron .h1 { color: inherit; } .jumbotron p { margin-bottom: 15px; font-size: 21px; font-weight: 200; } .jumbotron > hr { border-top-color: #d5d5d5; } .container .jumbotron, .container-fluid .jumbotron { border-radius: 6px; } .jumbotron .container { max-width: 100%; } @media screen and (min-width: 768px) { .jumbotron { padding-top: 48px; padding-bottom: 48px; } .container .jumbotron, .container-fluid .jumbotron { padding-right: 60px; padding-left: 60px; } .jumbotron h1, .jumbotron .h1 { font-size: 63px; } } .thumbnail { display: block; padding: 4px; margin-bottom: 20px; line-height: 1.42857143; background-color: #fff; border: 1px solid #ddd; border-radius: 4px; -webkit-transition: border .2s ease-in-out; -o-transition: border .2s ease-in-out; transition: border .2s ease-in-out; } .thumbnail > img, .thumbnail a > img { margin-right: auto; margin-left: auto; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { border-color: #337ab7; } .thumbnail .caption { padding: 9px; color: #333; } .alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; } .alert h4 { margin-top: 0; color: inherit; } .alert .alert-link { font-weight: bold; } .alert > p, .alert > ul { margin-bottom: 0; } .alert > p + p { margin-top: 5px; } .alert-dismissable, .alert-dismissible { padding-right: 35px; } .alert-dismissable .close, .alert-dismissible .close { position: relative; top: -2px; right: -21px; color: inherit; } .alert-success { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; } .alert-success hr { border-top-color: #c9e2b3; } .alert-success .alert-link { color: #2b542c; } .alert-info { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; } .alert-info hr { border-top-color: #a6e1ec; } .alert-info .alert-link { color: #245269; } .alert-warning { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; } .alert-warning hr { border-top-color: #f7e1b5; } .alert-warning .alert-link { color: #66512c; } .alert-danger { color: #a94442; background-color: #f2dede; border-color: #ebccd1; } .alert-danger hr { border-top-color: #e4b9c0; } .alert-danger .alert-link { color: #843534; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-o-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { height: 20px; margin-bottom: 20px; overflow: hidden; background-color: #f5f5f5; border-radius: 4px; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); } .progress-bar { float: left; width: 0; height: 100%; font-size: 12px; line-height: 20px; color: #fff; text-align: center; background-color: #337ab7; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); -webkit-transition: width .6s ease; -o-transition: width .6s ease; transition: width .6s ease; } .progress-striped .progress-bar, .progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -webkit-background-size: 40px 40px; background-size: 40px 40px; } .progress.active .progress-bar, .progress-bar.active { -webkit-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-bar-success { background-color: #5cb85c; } .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .progress-bar-info { background-color: #5bc0de; } .progress-striped .progress-bar-info { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .progress-bar-warning { background-color: #f0ad4e; } .progress-striped .progress-bar-warning { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .progress-bar-danger { background-color: #d9534f; } .progress-striped .progress-bar-danger { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .media { margin-top: 15px; } .media:first-child { margin-top: 0; } .media, .media-body { overflow: hidden; zoom: 1; } .media-body { width: 10000px; } .media-object { display: block; } .media-object.img-thumbnail { max-width: none; } .media-right, .media > .pull-right { padding-left: 10px; } .media-left, .media > .pull-left { padding-right: 10px; } .media-left, .media-right, .media-body { display: table-cell; vertical-align: top; } .media-middle { vertical-align: middle; } .media-bottom { vertical-align: bottom; } .media-heading { margin-top: 0; margin-bottom: 5px; } .media-list { padding-left: 0; list-style: none; } .list-group { padding-left: 0; margin-bottom: 20px; } .list-group-item { position: relative; display: block; padding: 10px 15px; margin-bottom: -1px; background-color: #fff; border: 1px solid #ddd; } .list-group-item:first-child { border-top-left-radius: 4px; border-top-right-radius: 4px; } .list-group-item:last-child { margin-bottom: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } a.list-group-item, button.list-group-item { color: #555; } a.list-group-item .list-group-item-heading, button.list-group-item .list-group-item-heading { color: #333; } a.list-group-item:hover, button.list-group-item:hover, a.list-group-item:focus, button.list-group-item:focus { color: #555; text-decoration: none; background-color: #f5f5f5; } button.list-group-item { width: 100%; text-align: left; } .list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus { color: #777; cursor: not-allowed; background-color: #eee; } .list-group-item.disabled .list-group-item-heading, .list-group-item.disabled:hover .list-group-item-heading, .list-group-item.disabled:focus .list-group-item-heading { color: inherit; } .list-group-item.disabled .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text { color: #777; } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { z-index: 2; color: #fff; background-color: #337ab7; border-color: #337ab7; } .list-group-item.active .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading > small, .list-group-item.active:focus .list-group-item-heading > small, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading > .small { color: inherit; } .list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text { color: #c7ddef; } .list-group-item-success { color: #3c763d; background-color: #dff0d8; } a.list-group-item-success, button.list-group-item-success { color: #3c763d; } a.list-group-item-success .list-group-item-heading, button.list-group-item-success .list-group-item-heading { color: inherit; } a.list-group-item-success:hover, button.list-group-item-success:hover, a.list-group-item-success:focus, button.list-group-item-success:focus { color: #3c763d; background-color: #d0e9c6; } a.list-group-item-success.active, button.list-group-item-success.active, a.list-group-item-success.active:hover, button.list-group-item-success.active:hover, a.list-group-item-success.active:focus, button.list-group-item-success.active:focus { color: #fff; background-color: #3c763d; border-color: #3c763d; } .list-group-item-info { color: #31708f; background-color: #d9edf7; } a.list-group-item-info, button.list-group-item-info { color: #31708f; } a.list-group-item-info .list-group-item-heading, button.list-group-item-info .list-group-item-heading { color: inherit; } a.list-group-item-info:hover, button.list-group-item-info:hover, a.list-group-item-info:focus, button.list-group-item-info:focus { color: #31708f; background-color: #c4e3f3; } a.list-group-item-info.active, button.list-group-item-info.active, a.list-group-item-info.active:hover, button.list-group-item-info.active:hover, a.list-group-item-info.active:focus, button.list-group-item-info.active:focus { color: #fff; background-color: #31708f; border-color: #31708f; } .list-group-item-warning { color: #8a6d3b; background-color: #fcf8e3; } a.list-group-item-warning, button.list-group-item-warning { color: #8a6d3b; } a.list-group-item-warning .list-group-item-heading, button.list-group-item-warning .list-group-item-heading { color: inherit; } a.list-group-item-warning:hover, button.list-group-item-warning:hover, a.list-group-item-warning:focus, button.list-group-item-warning:focus { color: #8a6d3b; background-color: #faf2cc; } a.list-group-item-warning.active, button.list-group-item-warning.active, a.list-group-item-warning.active:hover, button.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus, button.list-group-item-warning.active:focus { color: #fff; background-color: #8a6d3b; border-color: #8a6d3b; } .list-group-item-danger { color: #a94442; background-color: #f2dede; } a.list-group-item-danger, button.list-group-item-danger { color: #a94442; } a.list-group-item-danger .list-group-item-heading, button.list-group-item-danger .list-group-item-heading { color: inherit; } a.list-group-item-danger:hover, button.list-group-item-danger:hover, a.list-group-item-danger:focus, button.list-group-item-danger:focus { color: #a94442; background-color: #ebcccc; } a.list-group-item-danger.active, button.list-group-item-danger.active, a.list-group-item-danger.active:hover, button.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus, button.list-group-item-danger.active:focus { color: #fff; background-color: #a94442; border-color: #a94442; } .list-group-item-heading { margin-top: 0; margin-bottom: 5px; } .list-group-item-text { margin-bottom: 0; line-height: 1.3; } .panel { margin-bottom: 20px; background-color: #fff; border: 1px solid transparent; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); box-shadow: 0 1px 1px rgba(0, 0, 0, .05); } .panel-body { padding: 15px; } .panel-heading { padding: 10px 15px; border-bottom: 1px solid transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; } .panel-heading > .dropdown .dropdown-toggle { color: inherit; } .panel-title { margin-top: 0; margin-bottom: 0; font-size: 16px; color: inherit; } .panel-title > a, .panel-title > small, .panel-title > .small, .panel-title > small > a, .panel-title > .small > a { color: inherit; } .panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #ddd; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .list-group, .panel > .panel-collapse > .list-group { margin-bottom: 0; } .panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item { border-width: 1px 0; border-radius: 0; } .panel > .list-group:first-child .list-group-item:first-child, .panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { border-top: 0; border-top-left-radius: 3px; border-top-right-radius: 3px; } .panel > .list-group:last-child .list-group-item:last-child, .panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { border-bottom: 0; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { border-top-left-radius: 0; border-top-right-radius: 0; } .panel-heading + .list-group .list-group-item:first-child { border-top-width: 0; } .list-group + .panel-footer { border-top-width: 0; } .panel > .table, .panel > .table-responsive > .table, .panel > .panel-collapse > .table { margin-bottom: 0; } .panel > .table caption, .panel > .table-responsive > .table caption, .panel > .panel-collapse > .table caption { padding-right: 15px; padding-left: 15px; } .panel > .table:first-child, .panel > .table-responsive:first-child > .table:first-child { border-top-left-radius: 3px; border-top-right-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { border-top-left-radius: 3px; border-top-right-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { border-top-left-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { border-top-right-radius: 3px; } .panel > .table:last-child, .panel > .table-responsive:last-child > .table:last-child { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { border-bottom-right-radius: 3px; } .panel > .panel-body + .table, .panel > .panel-body + .table-responsive, .panel > .table + .panel-body, .panel > .table-responsive + .panel-body { border-top: 1px solid #ddd; } .panel > .table > tbody:first-child > tr:first-child th, .panel > .table > tbody:first-child > tr:first-child td { border-top: 0; } .panel > .table-bordered, .panel > .table-responsive > .table-bordered { border: 0; } .panel > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .panel > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { border-bottom: 0; } .panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { border-bottom: 0; } .panel > .table-responsive { margin-bottom: 0; border: 0; } .panel-group { margin-bottom: 20px; } .panel-group .panel { margin-bottom: 0; border-radius: 4px; } .panel-group .panel + .panel { margin-top: 5px; } .panel-group .panel-heading { border-bottom: 0; } .panel-group .panel-heading + .panel-collapse > .panel-body, .panel-group .panel-heading + .panel-collapse > .list-group { border-top: 1px solid #ddd; } .panel-group .panel-footer { border-top: 0; } .panel-group .panel-footer + .panel-collapse .panel-body { border-bottom: 1px solid #ddd; } .panel-default { border-color: #ddd; } .panel-default > .panel-heading { color: #333; background-color: #f5f5f5; border-color: #ddd; } .panel-default > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ddd; } .panel-default > .panel-heading .badge { color: #f5f5f5; background-color: #333; } .panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ddd; } .panel-primary { border-color: #337ab7; } .panel-primary > .panel-heading { color: #fff; background-color: #337ab7; border-color: #337ab7; } .panel-primary > .panel-heading + .panel-collapse > .panel-body { border-top-color: #337ab7; } .panel-primary > .panel-heading .badge { color: #337ab7; background-color: #fff; } .panel-primary > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #337ab7; } .panel-success { border-color: #d6e9c6; } .panel-success > .panel-heading { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; } .panel-success > .panel-heading + .panel-collapse > .panel-body { border-top-color: #d6e9c6; } .panel-success > .panel-heading .badge { color: #dff0d8; background-color: #3c763d; } .panel-success > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #d6e9c6; } .panel-info { border-color: #bce8f1; } .panel-info > .panel-heading { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; } .panel-info > .panel-heading + .panel-collapse > .panel-body { border-top-color: #bce8f1; } .panel-info > .panel-heading .badge { color: #d9edf7; background-color: #31708f; } .panel-info > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #bce8f1; } .panel-warning { border-color: #faebcc; } .panel-warning > .panel-heading { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; } .panel-warning > .panel-heading + .panel-collapse > .panel-body { border-top-color: #faebcc; } .panel-warning > .panel-heading .badge { color: #fcf8e3; background-color: #8a6d3b; } .panel-warning > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #faebcc; } .panel-danger { border-color: #ebccd1; } .panel-danger > .panel-heading { color: #a94442; background-color: #f2dede; border-color: #ebccd1; } .panel-danger > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ebccd1; } .panel-danger > .panel-heading .badge { color: #f2dede; background-color: #a94442; } .panel-danger > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ebccd1; } .embed-responsive { position: relative; display: block; height: 0; padding: 0; overflow: hidden; } .embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object, .embed-responsive video { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; height: 100%; border: 0; } .embed-responsive-16by9 { padding-bottom: 56.25%; } .embed-responsive-4by3 { padding-bottom: 75%; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, .15); } .well-lg { padding: 24px; border-radius: 6px; } .well-sm { padding: 9px; border-radius: 3px; } .close { float: right; font-size: 21px; font-weight: bold; line-height: 1; color: #000; text-shadow: 0 1px 0 #fff; filter: alpha(opacity=20); opacity: .2; } .close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; filter: alpha(opacity=50); opacity: .5; } button.close { -webkit-appearance: none; padding: 0; cursor: pointer; background: transparent; border: 0; } .modal-open { overflow: hidden; } .modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; display: none; overflow: hidden; -webkit-overflow-scrolling: touch; outline: 0; } .modal.fade .modal-dialog { -webkit-transition: -webkit-transform .3s ease-out; -o-transition: -o-transform .3s ease-out; transition: transform .3s ease-out; -webkit-transform: translate(0, -25%); -ms-transform: translate(0, -25%); -o-transform: translate(0, -25%); transform: translate(0, -25%); } .modal.in .modal-dialog { -webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); -o-transform: translate(0, 0); transform: translate(0, 0); } .modal-open .modal { overflow-x: hidden; overflow-y: auto; } .modal-dialog { position: relative; width: auto; margin: 10px; } .modal-content { position: relative; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #999; border: 1px solid rgba(0, 0, 0, .2); border-radius: 6px; outline: 0; -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); box-shadow: 0 3px 9px rgba(0, 0, 0, .5); } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000; } .modal-backdrop.fade { filter: alpha(opacity=0); opacity: 0; } .modal-backdrop.in { filter: alpha(opacity=50); opacity: .5; } .modal-header { min-height: 16.42857143px; padding: 15px; border-bottom: 1px solid #e5e5e5; } .modal-header .close { margin-top: -2px; } .modal-title { margin: 0; line-height: 1.42857143; } .modal-body { position: relative; padding: 15px; } .modal-footer { padding: 15px; text-align: right; border-top: 1px solid #e5e5e5; } .modal-footer .btn + .btn { margin-bottom: 0; margin-left: 5px; } .modal-footer .btn-group .btn + .btn { margin-left: -1px; } .modal-footer .btn-block + .btn-block { margin-left: 0; } .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } @media (min-width: 768px) { .modal-dialog { width: 600px; margin: 30px auto; } .modal-content { -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5); box-shadow: 0 5px 15px rgba(0, 0, 0, .5); } .modal-sm { width: 300px; } } @media (min-width: 992px) { .modal-lg { width: 900px; } } .tooltip { position: absolute; z-index: 1070; display: block; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.42857143; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; letter-spacing: normal; word-break: normal; word-spacing: normal; word-wrap: normal; white-space: normal; filter: alpha(opacity=0); opacity: 0; line-break: auto; } .tooltip.in { filter: alpha(opacity=90); opacity: .9; } .tooltip.top { padding: 5px 0; margin-top: -3px; } .tooltip.right { padding: 0 5px; margin-left: 3px; } .tooltip.bottom { padding: 5px 0; margin-top: 3px; } .tooltip.left { padding: 0 5px; margin-left: -3px; } .tooltip-inner { max-width: 200px; padding: 3px 8px; color: #fff; text-align: center; background-color: #000; border-radius: 4px; } .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.top-left .tooltip-arrow { right: 5px; bottom: 0; margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.top-right .tooltip-arrow { bottom: 0; left: 5px; margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .tooltip.bottom-left .tooltip-arrow { top: 0; right: 5px; margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .tooltip.bottom-right .tooltip-arrow { top: 0; left: 5px; margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .popover { position: absolute; top: 0; left: 0; z-index: 1060; display: none; max-width: 276px; padding: 1px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; line-height: 1.42857143; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; letter-spacing: normal; word-break: normal; word-spacing: normal; word-wrap: normal; white-space: normal; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, .2); border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); box-shadow: 0 5px 10px rgba(0, 0, 0, .2); line-break: auto; } .popover.top { margin-top: -10px; } .popover.right { margin-left: 10px; } .popover.bottom { margin-top: 10px; } .popover.left { margin-left: -10px; } .popover-title { padding: 8px 14px; margin: 0; font-size: 14px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-radius: 5px 5px 0 0; } .popover-content { padding: 9px 14px; } .popover > .arrow, .popover > .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; } .popover > .arrow { border-width: 11px; } .popover > .arrow:after { content: ""; border-width: 10px; } .popover.top > .arrow { bottom: -11px; left: 50%; margin-left: -11px; border-top-color: #999; border-top-color: rgba(0, 0, 0, .25); border-bottom-width: 0; } .popover.top > .arrow:after { bottom: 1px; margin-left: -10px; content: " "; border-top-color: #fff; border-bottom-width: 0; } .popover.right > .arrow { top: 50%; left: -11px; margin-top: -11px; border-right-color: #999; border-right-color: rgba(0, 0, 0, .25); border-left-width: 0; } .popover.right > .arrow:after { bottom: -10px; left: 1px; content: " "; border-right-color: #fff; border-left-width: 0; } .popover.bottom > .arrow { top: -11px; left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #999; border-bottom-color: rgba(0, 0, 0, .25); } .popover.bottom > .arrow:after { top: 1px; margin-left: -10px; content: " "; border-top-width: 0; border-bottom-color: #fff; } .popover.left > .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #999; border-left-color: rgba(0, 0, 0, .25); } .popover.left > .arrow:after { right: 1px; bottom: -10px; content: " "; border-right-width: 0; border-left-color: #fff; } .carousel { position: relative; } .carousel-inner { position: relative; width: 100%; overflow: hidden; } .carousel-inner > .item { position: relative; display: none; -webkit-transition: .6s ease-in-out left; -o-transition: .6s ease-in-out left; transition: .6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { line-height: 1; } @media all and (transform-3d), (-webkit-transform-3d) { .carousel-inner > .item { -webkit-transition: -webkit-transform .6s ease-in-out; -o-transition: -o-transform .6s ease-in-out; transition: transform .6s ease-in-out; -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-perspective: 1000px; perspective: 1000px; } .carousel-inner > .item.next, .carousel-inner > .item.active.right { left: 0; -webkit-transform: translate3d(100%, 0, 0); transform: translate3d(100%, 0, 0); } .carousel-inner > .item.prev, .carousel-inner > .item.active.left { left: 0; -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); } .carousel-inner > .item.next.left, .carousel-inner > .item.prev.right, .carousel-inner > .item.active { left: 0; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { display: block; } .carousel-inner > .active { left: 0; } .carousel-inner > .next, .carousel-inner > .prev { position: absolute; top: 0; width: 100%; } .carousel-inner > .next { left: 100%; } .carousel-inner > .prev { left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { left: 0; } .carousel-inner > .active.left { left: -100%; } .carousel-inner > .active.right { left: 100%; } .carousel-control { position: absolute; top: 0; bottom: 0; left: 0; width: 15%; font-size: 20px; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); filter: alpha(opacity=50); opacity: .5; } .carousel-control.left { background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001))); background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); background-repeat: repeat-x; } .carousel-control.right { right: 0; left: auto; background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5))); background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); background-repeat: repeat-x; } .carousel-control:hover, .carousel-control:focus { color: #fff; text-decoration: none; filter: alpha(opacity=90); outline: 0; opacity: .9; } .carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { position: absolute; top: 50%; z-index: 5; display: inline-block; margin-top: -10px; } .carousel-control .icon-prev, .carousel-control .glyphicon-chevron-left { left: 50%; margin-left: -10px; } .carousel-control .icon-next, .carousel-control .glyphicon-chevron-right { right: 50%; margin-right: -10px; } .carousel-control .icon-prev, .carousel-control .icon-next { width: 20px; height: 20px; font-family: serif; line-height: 1; } .carousel-control .icon-prev:before { content: '\2039'; } .carousel-control .icon-next:before { content: '\203a'; } .carousel-indicators { position: absolute; bottom: 10px; left: 50%; z-index: 15; width: 60%; padding-left: 0; margin-left: -30%; text-align: center; list-style: none; } .carousel-indicators li { display: inline-block; width: 10px; height: 10px; margin: 1px; text-indent: -999px; cursor: pointer; background-color: #000 \9; background-color: rgba(0, 0, 0, 0); border: 1px solid #fff; border-radius: 10px; } .carousel-indicators .active { width: 12px; height: 12px; margin: 0; background-color: #fff; } .carousel-caption { position: absolute; right: 15%; bottom: 20px; left: 15%; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); } .carousel-caption .btn { text-shadow: none; } @media screen and (min-width: 768px) { .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next { width: 30px; height: 30px; margin-top: -15px; font-size: 30px; } .carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev { margin-left: -15px; } .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next { margin-right: -15px; } .carousel-caption { right: 20%; left: 20%; padding-bottom: 30px; } .carousel-indicators { bottom: 20px; } } .clearfix:before, .clearfix:after, .dl-horizontal dd:before, .dl-horizontal dd:after, .container:before, .container:after, .container-fluid:before, .container-fluid:after, .row:before, .row:after, .form-horizontal .form-group:before, .form-horizontal .form-group:after, .btn-toolbar:before, .btn-toolbar:after, .btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after, .nav:before, .nav:after, .navbar:before, .navbar:after, .navbar-header:before, .navbar-header:after, .navbar-collapse:before, .navbar-collapse:after, .pager:before, .pager:after, .panel-body:before, .panel-body:after, .modal-footer:before, .modal-footer:after { display: table; content: " "; } .clearfix:after, .dl-horizontal dd:after, .container:after, .container-fluid:after, .row:after, .form-horizontal .form-group:after, .btn-toolbar:after, .btn-group-vertical > .btn-group:after, .nav:after, .navbar:after, .navbar-header:after, .navbar-collapse:after, .pager:after, .panel-body:after, .modal-footer:after { clear: both; } .center-block { display: block; margin-right: auto; margin-left: auto; } .pull-right { float: right !important; } .pull-left { float: left !important; } .hide { display: none !important; } .show { display: block !important; } .invisible { visibility: hidden; } .text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .hidden { display: none !important; } .affix { position: fixed; } @-ms-viewport { width: device-width; } .visible-xs, .visible-sm, .visible-md, .visible-lg { display: none !important; } .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-lg-block, .visible-lg-inline, .visible-lg-inline-block { display: none !important; } @media (max-width: 767px) { .visible-xs { display: block !important; } table.visible-xs { display: table !important; } tr.visible-xs { display: table-row !important; } th.visible-xs, td.visible-xs { display: table-cell !important; } } @media (max-width: 767px) { .visible-xs-block { display: block !important; } } @media (max-width: 767px) { .visible-xs-inline { display: inline !important; } } @media (max-width: 767px) { .visible-xs-inline-block { display: inline-block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm { display: block !important; } table.visible-sm { display: table !important; } tr.visible-sm { display: table-row !important; } th.visible-sm, td.visible-sm { display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-block { display: block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline { display: inline !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline-block { display: inline-block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md { display: block !important; } table.visible-md { display: table !important; } tr.visible-md { display: table-row !important; } th.visible-md, td.visible-md { display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-block { display: block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline { display: inline !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline-block { display: inline-block !important; } } @media (min-width: 1200px) { .visible-lg { display: block !important; } table.visible-lg { display: table !important; } tr.visible-lg { display: table-row !important; } th.visible-lg, td.visible-lg { display: table-cell !important; } } @media (min-width: 1200px) { .visible-lg-block { display: block !important; } } @media (min-width: 1200px) { .visible-lg-inline { display: inline !important; } } @media (min-width: 1200px) { .visible-lg-inline-block { display: inline-block !important; } } @media (max-width: 767px) { .hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { .hidden-md { display: none !important; } } @media (min-width: 1200px) { .hidden-lg { display: none !important; } } .visible-print { display: none !important; } @media print { .visible-print { display: block !important; } table.visible-print { display: table !important; } tr.visible-print { display: table-row !important; } th.visible-print, td.visible-print { display: table-cell !important; } } .visible-print-block { display: none !important; } @media print { .visible-print-block { display: block !important; } } .visible-print-inline { display: none !important; } @media print { .visible-print-inline { display: inline !important; } } .visible-print-inline-block { display: none !important; } @media print { .visible-print-inline-block { display: inline-block !important; } } @media print { .hidden-print { display: none !important; } } /*# sourceMappingURL=bootstrap.css.map */ ================================================ FILE: Blog.IdentityServer/wwwroot/lib/bootstrap/js/bootstrap.js ================================================ /*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under the MIT license */ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } +function ($) { 'use strict'; var version = $.fn.jquery.split(' ')[0].split('.') if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) { throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher') } }(jQuery); /* ======================================================================== * Bootstrap: transition.js v3.3.5 * http://getbootstrap.com/javascript/#transitions * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) // ============================================================ function transitionEnd() { var el = document.createElement('bootstrap') var transEndEventNames = { WebkitTransition : 'webkitTransitionEnd', MozTransition : 'transitionend', OTransition : 'oTransitionEnd otransitionend', transition : 'transitionend' } for (var name in transEndEventNames) { if (el.style[name] !== undefined) { return { end: transEndEventNames[name] } } } return false // explicit for ie8 ( ._.) } // http://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function (duration) { var called = false var $el = this $(this).one('bsTransitionEnd', function () { called = true }) var callback = function () { if (!called) $($el).trigger($.support.transition.end) } setTimeout(callback, duration) return this } $(function () { $.support.transition = transitionEnd() if (!$.support.transition) return $.event.special.bsTransitionEnd = { bindType: $.support.transition.end, delegateType: $.support.transition.end, handle: function (e) { if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) } } }) }(jQuery); /* ======================================================================== * Bootstrap: alert.js v3.3.5 * http://getbootstrap.com/javascript/#alerts * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // ALERT CLASS DEFINITION // ====================== var dismiss = '[data-dismiss="alert"]' var Alert = function (el) { $(el).on('click', dismiss, this.close) } Alert.VERSION = '3.3.5' Alert.TRANSITION_DURATION = 150 Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = $(selector) if (e) e.preventDefault() if (!$parent.length) { $parent = $this.closest('.alert') } $parent.trigger(e = $.Event('close.bs.alert')) if (e.isDefaultPrevented()) return $parent.removeClass('in') function removeElement() { // detach from parent, fire event then clean up data $parent.detach().trigger('closed.bs.alert').remove() } $.support.transition && $parent.hasClass('fade') ? $parent .one('bsTransitionEnd', removeElement) .emulateTransitionEnd(Alert.TRANSITION_DURATION) : removeElement() } // ALERT PLUGIN DEFINITION // ======================= function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.alert') if (!data) $this.data('bs.alert', (data = new Alert(this))) if (typeof option == 'string') data[option].call($this) }) } var old = $.fn.alert $.fn.alert = Plugin $.fn.alert.Constructor = Alert // ALERT NO CONFLICT // ================= $.fn.alert.noConflict = function () { $.fn.alert = old return this } // ALERT DATA-API // ============== $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) }(jQuery); /* ======================================================================== * Bootstrap: button.js v3.3.5 * http://getbootstrap.com/javascript/#buttons * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // BUTTON PUBLIC CLASS DEFINITION // ============================== var Button = function (element, options) { this.$element = $(element) this.options = $.extend({}, Button.DEFAULTS, options) this.isLoading = false } Button.VERSION = '3.3.5' Button.DEFAULTS = { loadingText: 'loading...' } Button.prototype.setState = function (state) { var d = 'disabled' var $el = this.$element var val = $el.is('input') ? 'val' : 'html' var data = $el.data() state += 'Text' if (data.resetText == null) $el.data('resetText', $el[val]()) // push to event loop to allow forms to submit setTimeout($.proxy(function () { $el[val](data[state] == null ? this.options[state] : data[state]) if (state == 'loadingText') { this.isLoading = true $el.addClass(d).attr(d, d) } else if (this.isLoading) { this.isLoading = false $el.removeClass(d).removeAttr(d) } }, this), 0) } Button.prototype.toggle = function () { var changed = true var $parent = this.$element.closest('[data-toggle="buttons"]') if ($parent.length) { var $input = this.$element.find('input') if ($input.prop('type') == 'radio') { if ($input.prop('checked')) changed = false $parent.find('.active').removeClass('active') this.$element.addClass('active') } else if ($input.prop('type') == 'checkbox') { if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false this.$element.toggleClass('active') } $input.prop('checked', this.$element.hasClass('active')) if (changed) $input.trigger('change') } else { this.$element.attr('aria-pressed', !this.$element.hasClass('active')) this.$element.toggleClass('active') } } // BUTTON PLUGIN DEFINITION // ======================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.button') var options = typeof option == 'object' && option if (!data) $this.data('bs.button', (data = new Button(this, options))) if (option == 'toggle') data.toggle() else if (option) data.setState(option) }) } var old = $.fn.button $.fn.button = Plugin $.fn.button.Constructor = Button // BUTTON NO CONFLICT // ================== $.fn.button.noConflict = function () { $.fn.button = old return this } // BUTTON DATA-API // =============== $(document) .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { var $btn = $(e.target) if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') Plugin.call($btn, 'toggle') if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault() }) .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) }) }(jQuery); /* ======================================================================== * Bootstrap: carousel.js v3.3.5 * http://getbootstrap.com/javascript/#carousel * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // CAROUSEL CLASS DEFINITION // ========================= var Carousel = function (element, options) { this.$element = $(element) this.$indicators = this.$element.find('.carousel-indicators') this.options = options this.paused = null this.sliding = null this.interval = null this.$active = null this.$items = null this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) } Carousel.VERSION = '3.3.5' Carousel.TRANSITION_DURATION = 600 Carousel.DEFAULTS = { interval: 5000, pause: 'hover', wrap: true, keyboard: true } Carousel.prototype.keydown = function (e) { if (/input|textarea/i.test(e.target.tagName)) return switch (e.which) { case 37: this.prev(); break case 39: this.next(); break default: return } e.preventDefault() } Carousel.prototype.cycle = function (e) { e || (this.paused = false) this.interval && clearInterval(this.interval) this.options.interval && !this.paused && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) return this } Carousel.prototype.getItemIndex = function (item) { this.$items = item.parent().children('.item') return this.$items.index(item || this.$active) } Carousel.prototype.getItemForDirection = function (direction, active) { var activeIndex = this.getItemIndex(active) var willWrap = (direction == 'prev' && activeIndex === 0) || (direction == 'next' && activeIndex == (this.$items.length - 1)) if (willWrap && !this.options.wrap) return active var delta = direction == 'prev' ? -1 : 1 var itemIndex = (activeIndex + delta) % this.$items.length return this.$items.eq(itemIndex) } Carousel.prototype.to = function (pos) { var that = this var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) if (pos > (this.$items.length - 1) || pos < 0) return if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" if (activeIndex == pos) return this.pause().cycle() return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) } Carousel.prototype.pause = function (e) { e || (this.paused = true) if (this.$element.find('.next, .prev').length && $.support.transition) { this.$element.trigger($.support.transition.end) this.cycle(true) } this.interval = clearInterval(this.interval) return this } Carousel.prototype.next = function () { if (this.sliding) return return this.slide('next') } Carousel.prototype.prev = function () { if (this.sliding) return return this.slide('prev') } Carousel.prototype.slide = function (type, next) { var $active = this.$element.find('.item.active') var $next = next || this.getItemForDirection(type, $active) var isCycling = this.interval var direction = type == 'next' ? 'left' : 'right' var that = this if ($next.hasClass('active')) return (this.sliding = false) var relatedTarget = $next[0] var slideEvent = $.Event('slide.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) this.$element.trigger(slideEvent) if (slideEvent.isDefaultPrevented()) return this.sliding = true isCycling && this.pause() if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) $nextIndicator && $nextIndicator.addClass('active') } var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" if ($.support.transition && this.$element.hasClass('slide')) { $next.addClass(type) $next[0].offsetWidth // force reflow $active.addClass(direction) $next.addClass(direction) $active .one('bsTransitionEnd', function () { $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false setTimeout(function () { that.$element.trigger(slidEvent) }, 0) }) .emulateTransitionEnd(Carousel.TRANSITION_DURATION) } else { $active.removeClass('active') $next.addClass('active') this.sliding = false this.$element.trigger(slidEvent) } isCycling && this.cycle() return this } // CAROUSEL PLUGIN DEFINITION // ========================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.carousel') var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) var action = typeof option == 'string' ? option : options.slide if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) if (typeof option == 'number') data.to(option) else if (action) data[action]() else if (options.interval) data.pause().cycle() }) } var old = $.fn.carousel $.fn.carousel = Plugin $.fn.carousel.Constructor = Carousel // CAROUSEL NO CONFLICT // ==================== $.fn.carousel.noConflict = function () { $.fn.carousel = old return this } // CAROUSEL DATA-API // ================= var clickHandler = function (e) { var href var $this = $(this) var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 if (!$target.hasClass('carousel')) return var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') if (slideIndex) options.interval = false Plugin.call($target, options) if (slideIndex) { $target.data('bs.carousel').to(slideIndex) } e.preventDefault() } $(document) .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) $(window).on('load', function () { $('[data-ride="carousel"]').each(function () { var $carousel = $(this) Plugin.call($carousel, $carousel.data()) }) }) }(jQuery); /* ======================================================================== * Bootstrap: collapse.js v3.3.5 * http://getbootstrap.com/javascript/#collapse * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // COLLAPSE PUBLIC CLASS DEFINITION // ================================ var Collapse = function (element, options) { this.$element = $(element) this.options = $.extend({}, Collapse.DEFAULTS, options) this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + '[data-toggle="collapse"][data-target="#' + element.id + '"]') this.transitioning = null if (this.options.parent) { this.$parent = this.getParent() } else { this.addAriaAndCollapsedClass(this.$element, this.$trigger) } if (this.options.toggle) this.toggle() } Collapse.VERSION = '3.3.5' Collapse.TRANSITION_DURATION = 350 Collapse.DEFAULTS = { toggle: true } Collapse.prototype.dimension = function () { var hasWidth = this.$element.hasClass('width') return hasWidth ? 'width' : 'height' } Collapse.prototype.show = function () { if (this.transitioning || this.$element.hasClass('in')) return var activesData var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') if (actives && actives.length) { activesData = actives.data('bs.collapse') if (activesData && activesData.transitioning) return } var startEvent = $.Event('show.bs.collapse') this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return if (actives && actives.length) { Plugin.call(actives, 'hide') activesData || actives.data('bs.collapse', null) } var dimension = this.dimension() this.$element .removeClass('collapse') .addClass('collapsing')[dimension](0) .attr('aria-expanded', true) this.$trigger .removeClass('collapsed') .attr('aria-expanded', true) this.transitioning = 1 var complete = function () { this.$element .removeClass('collapsing') .addClass('collapse in')[dimension]('') this.transitioning = 0 this.$element .trigger('shown.bs.collapse') } if (!$.support.transition) return complete.call(this) var scrollSize = $.camelCase(['scroll', dimension].join('-')) this.$element .one('bsTransitionEnd', $.proxy(complete, this)) .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) } Collapse.prototype.hide = function () { if (this.transitioning || !this.$element.hasClass('in')) return var startEvent = $.Event('hide.bs.collapse') this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return var dimension = this.dimension() this.$element[dimension](this.$element[dimension]())[0].offsetHeight this.$element .addClass('collapsing') .removeClass('collapse in') .attr('aria-expanded', false) this.$trigger .addClass('collapsed') .attr('aria-expanded', false) this.transitioning = 1 var complete = function () { this.transitioning = 0 this.$element .removeClass('collapsing') .addClass('collapse') .trigger('hidden.bs.collapse') } if (!$.support.transition) return complete.call(this) this.$element [dimension](0) .one('bsTransitionEnd', $.proxy(complete, this)) .emulateTransitionEnd(Collapse.TRANSITION_DURATION) } Collapse.prototype.toggle = function () { this[this.$element.hasClass('in') ? 'hide' : 'show']() } Collapse.prototype.getParent = function () { return $(this.options.parent) .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') .each($.proxy(function (i, element) { var $element = $(element) this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) }, this)) .end() } Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { var isOpen = $element.hasClass('in') $element.attr('aria-expanded', isOpen) $trigger .toggleClass('collapsed', !isOpen) .attr('aria-expanded', isOpen) } function getTargetFromTrigger($trigger) { var href var target = $trigger.attr('data-target') || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 return $(target) } // COLLAPSE PLUGIN DEFINITION // ========================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.collapse') var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) } var old = $.fn.collapse $.fn.collapse = Plugin $.fn.collapse.Constructor = Collapse // COLLAPSE NO CONFLICT // ==================== $.fn.collapse.noConflict = function () { $.fn.collapse = old return this } // COLLAPSE DATA-API // ================= $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { var $this = $(this) if (!$this.attr('data-target')) e.preventDefault() var $target = getTargetFromTrigger($this) var data = $target.data('bs.collapse') var option = data ? 'toggle' : $this.data() Plugin.call($target, option) }) }(jQuery); /* ======================================================================== * Bootstrap: dropdown.js v3.3.5 * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // DROPDOWN CLASS DEFINITION // ========================= var backdrop = '.dropdown-backdrop' var toggle = '[data-toggle="dropdown"]' var Dropdown = function (element) { $(element).on('click.bs.dropdown', this.toggle) } Dropdown.VERSION = '3.3.5' function getParent($this) { var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = selector && $(selector) return $parent && $parent.length ? $parent : $this.parent() } function clearMenus(e) { if (e && e.which === 3) return $(backdrop).remove() $(toggle).each(function () { var $this = $(this) var $parent = getParent($this) var relatedTarget = { relatedTarget: this } if (!$parent.hasClass('open')) return if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) if (e.isDefaultPrevented()) return $this.attr('aria-expanded', 'false') $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) }) } Dropdown.prototype.toggle = function (e) { var $this = $(this) if ($this.is('.disabled, :disabled')) return var $parent = getParent($this) var isActive = $parent.hasClass('open') clearMenus() if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { // if mobile we use a backdrop because click events don't delegate $(document.createElement('div')) .addClass('dropdown-backdrop') .insertAfter($(this)) .on('click', clearMenus) } var relatedTarget = { relatedTarget: this } $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) if (e.isDefaultPrevented()) return $this .trigger('focus') .attr('aria-expanded', 'true') $parent .toggleClass('open') .trigger('shown.bs.dropdown', relatedTarget) } return false } Dropdown.prototype.keydown = function (e) { if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return var $this = $(this) e.preventDefault() e.stopPropagation() if ($this.is('.disabled, :disabled')) return var $parent = getParent($this) var isActive = $parent.hasClass('open') if (!isActive && e.which != 27 || isActive && e.which == 27) { if (e.which == 27) $parent.find(toggle).trigger('focus') return $this.trigger('click') } var desc = ' li:not(.disabled):visible a' var $items = $parent.find('.dropdown-menu' + desc) if (!$items.length) return var index = $items.index(e.target) if (e.which == 38 && index > 0) index-- // up if (e.which == 40 && index < $items.length - 1) index++ // down if (!~index) index = 0 $items.eq(index).trigger('focus') } // DROPDOWN PLUGIN DEFINITION // ========================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.dropdown') if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) if (typeof option == 'string') data[option].call($this) }) } var old = $.fn.dropdown $.fn.dropdown = Plugin $.fn.dropdown.Constructor = Dropdown // DROPDOWN NO CONFLICT // ==================== $.fn.dropdown.noConflict = function () { $.fn.dropdown = old return this } // APPLY TO STANDARD DROPDOWN ELEMENTS // =================================== $(document) .on('click.bs.dropdown.data-api', clearMenus) .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) }(jQuery); /* ======================================================================== * Bootstrap: modal.js v3.3.5 * http://getbootstrap.com/javascript/#modals * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // MODAL CLASS DEFINITION // ====================== var Modal = function (element, options) { this.options = options this.$body = $(document.body) this.$element = $(element) this.$dialog = this.$element.find('.modal-dialog') this.$backdrop = null this.isShown = null this.originalBodyPad = null this.scrollbarWidth = 0 this.ignoreBackdropClick = false if (this.options.remote) { this.$element .find('.modal-content') .load(this.options.remote, $.proxy(function () { this.$element.trigger('loaded.bs.modal') }, this)) } } Modal.VERSION = '3.3.5' Modal.TRANSITION_DURATION = 300 Modal.BACKDROP_TRANSITION_DURATION = 150 Modal.DEFAULTS = { backdrop: true, keyboard: true, show: true } Modal.prototype.toggle = function (_relatedTarget) { return this.isShown ? this.hide() : this.show(_relatedTarget) } Modal.prototype.show = function (_relatedTarget) { var that = this var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) this.$element.trigger(e) if (this.isShown || e.isDefaultPrevented()) return this.isShown = true this.checkScrollbar() this.setScrollbar() this.$body.addClass('modal-open') this.escape() this.resize() this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) this.$dialog.on('mousedown.dismiss.bs.modal', function () { that.$element.one('mouseup.dismiss.bs.modal', function (e) { if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true }) }) this.backdrop(function () { var transition = $.support.transition && that.$element.hasClass('fade') if (!that.$element.parent().length) { that.$element.appendTo(that.$body) // don't move modals dom position } that.$element .show() .scrollTop(0) that.adjustDialog() if (transition) { that.$element[0].offsetWidth // force reflow } that.$element.addClass('in') that.enforceFocus() var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) transition ? that.$dialog // wait for modal to slide in .one('bsTransitionEnd', function () { that.$element.trigger('focus').trigger(e) }) .emulateTransitionEnd(Modal.TRANSITION_DURATION) : that.$element.trigger('focus').trigger(e) }) } Modal.prototype.hide = function (e) { if (e) e.preventDefault() e = $.Event('hide.bs.modal') this.$element.trigger(e) if (!this.isShown || e.isDefaultPrevented()) return this.isShown = false this.escape() this.resize() $(document).off('focusin.bs.modal') this.$element .removeClass('in') .off('click.dismiss.bs.modal') .off('mouseup.dismiss.bs.modal') this.$dialog.off('mousedown.dismiss.bs.modal') $.support.transition && this.$element.hasClass('fade') ? this.$element .one('bsTransitionEnd', $.proxy(this.hideModal, this)) .emulateTransitionEnd(Modal.TRANSITION_DURATION) : this.hideModal() } Modal.prototype.enforceFocus = function () { $(document) .off('focusin.bs.modal') // guard against infinite focus loop .on('focusin.bs.modal', $.proxy(function (e) { if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { this.$element.trigger('focus') } }, this)) } Modal.prototype.escape = function () { if (this.isShown && this.options.keyboard) { this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { e.which == 27 && this.hide() }, this)) } else if (!this.isShown) { this.$element.off('keydown.dismiss.bs.modal') } } Modal.prototype.resize = function () { if (this.isShown) { $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) } else { $(window).off('resize.bs.modal') } } Modal.prototype.hideModal = function () { var that = this this.$element.hide() this.backdrop(function () { that.$body.removeClass('modal-open') that.resetAdjustments() that.resetScrollbar() that.$element.trigger('hidden.bs.modal') }) } Modal.prototype.removeBackdrop = function () { this.$backdrop && this.$backdrop.remove() this.$backdrop = null } Modal.prototype.backdrop = function (callback) { var that = this var animate = this.$element.hasClass('fade') ? 'fade' : '' if (this.isShown && this.options.backdrop) { var doAnimate = $.support.transition && animate this.$backdrop = $(document.createElement('div')) .addClass('modal-backdrop ' + animate) .appendTo(this.$body) this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { if (this.ignoreBackdropClick) { this.ignoreBackdropClick = false return } if (e.target !== e.currentTarget) return this.options.backdrop == 'static' ? this.$element[0].focus() : this.hide() }, this)) if (doAnimate) this.$backdrop[0].offsetWidth // force reflow this.$backdrop.addClass('in') if (!callback) return doAnimate ? this.$backdrop .one('bsTransitionEnd', callback) .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callback() } else if (!this.isShown && this.$backdrop) { this.$backdrop.removeClass('in') var callbackRemove = function () { that.removeBackdrop() callback && callback() } $.support.transition && this.$element.hasClass('fade') ? this.$backdrop .one('bsTransitionEnd', callbackRemove) .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callbackRemove() } else if (callback) { callback() } } // these following methods are used to handle overflowing modals Modal.prototype.handleUpdate = function () { this.adjustDialog() } Modal.prototype.adjustDialog = function () { var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight this.$element.css({ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' }) } Modal.prototype.resetAdjustments = function () { this.$element.css({ paddingLeft: '', paddingRight: '' }) } Modal.prototype.checkScrollbar = function () { var fullWindowWidth = window.innerWidth if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 var documentElementRect = document.documentElement.getBoundingClientRect() fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) } this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth this.scrollbarWidth = this.measureScrollbar() } Modal.prototype.setScrollbar = function () { var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) this.originalBodyPad = document.body.style.paddingRight || '' if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) } Modal.prototype.resetScrollbar = function () { this.$body.css('padding-right', this.originalBodyPad) } Modal.prototype.measureScrollbar = function () { // thx walsh var scrollDiv = document.createElement('div') scrollDiv.className = 'modal-scrollbar-measure' this.$body.append(scrollDiv) var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth this.$body[0].removeChild(scrollDiv) return scrollbarWidth } // MODAL PLUGIN DEFINITION // ======================= function Plugin(option, _relatedTarget) { return this.each(function () { var $this = $(this) var data = $this.data('bs.modal') var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data) $this.data('bs.modal', (data = new Modal(this, options))) if (typeof option == 'string') data[option](_relatedTarget) else if (options.show) data.show(_relatedTarget) }) } var old = $.fn.modal $.fn.modal = Plugin $.fn.modal.Constructor = Modal // MODAL NO CONFLICT // ================= $.fn.modal.noConflict = function () { $.fn.modal = old return this } // MODAL DATA-API // ============== $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { var $this = $(this) var href = $this.attr('href') var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) if ($this.is('a')) e.preventDefault() $target.one('show.bs.modal', function (showEvent) { if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown $target.one('hidden.bs.modal', function () { $this.is(':visible') && $this.trigger('focus') }) }) Plugin.call($target, option, this) }) }(jQuery); /* ======================================================================== * Bootstrap: tooltip.js v3.3.5 * http://getbootstrap.com/javascript/#tooltip * Inspired by the original jQuery.tipsy by Jason Frame * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // TOOLTIP PUBLIC CLASS DEFINITION // =============================== var Tooltip = function (element, options) { this.type = null this.options = null this.enabled = null this.timeout = null this.hoverState = null this.$element = null this.inState = null this.init('tooltip', element, options) } Tooltip.VERSION = '3.3.5' Tooltip.TRANSITION_DURATION = 150 Tooltip.DEFAULTS = { animation: true, placement: 'top', selector: false, template: '', trigger: 'hover focus', title: '', delay: 0, html: false, container: false, viewport: { selector: 'body', padding: 0 } } Tooltip.prototype.init = function (type, element, options) { this.enabled = true this.type = type this.$element = $(element) this.options = this.getOptions(options) this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) this.inState = { click: false, hover: false, focus: false } if (this.$element[0] instanceof document.constructor && !this.options.selector) { throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') } var triggers = this.options.trigger.split(' ') for (var i = triggers.length; i--;) { var trigger = triggers[i] if (trigger == 'click') { this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) } else if (trigger != 'manual') { var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) } } this.options.selector ? (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : this.fixTitle() } Tooltip.prototype.getDefaults = function () { return Tooltip.DEFAULTS } Tooltip.prototype.getOptions = function (options) { options = $.extend({}, this.getDefaults(), this.$element.data(), options) if (options.delay && typeof options.delay == 'number') { options.delay = { show: options.delay, hide: options.delay } } return options } Tooltip.prototype.getDelegateOptions = function () { var options = {} var defaults = this.getDefaults() this._options && $.each(this._options, function (key, value) { if (defaults[key] != value) options[key] = value }) return options } Tooltip.prototype.enter = function (obj) { var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type) if (!self) { self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) $(obj.currentTarget).data('bs.' + this.type, self) } if (obj instanceof $.Event) { self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true } if (self.tip().hasClass('in') || self.hoverState == 'in') { self.hoverState = 'in' return } clearTimeout(self.timeout) self.hoverState = 'in' if (!self.options.delay || !self.options.delay.show) return self.show() self.timeout = setTimeout(function () { if (self.hoverState == 'in') self.show() }, self.options.delay.show) } Tooltip.prototype.isInStateTrue = function () { for (var key in this.inState) { if (this.inState[key]) return true } return false } Tooltip.prototype.leave = function (obj) { var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type) if (!self) { self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) $(obj.currentTarget).data('bs.' + this.type, self) } if (obj instanceof $.Event) { self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false } if (self.isInStateTrue()) return clearTimeout(self.timeout) self.hoverState = 'out' if (!self.options.delay || !self.options.delay.hide) return self.hide() self.timeout = setTimeout(function () { if (self.hoverState == 'out') self.hide() }, self.options.delay.hide) } Tooltip.prototype.show = function () { var e = $.Event('show.bs.' + this.type) if (this.hasContent() && this.enabled) { this.$element.trigger(e) var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) if (e.isDefaultPrevented() || !inDom) return var that = this var $tip = this.tip() var tipId = this.getUID(this.type) this.setContent() $tip.attr('id', tipId) this.$element.attr('aria-describedby', tipId) if (this.options.animation) $tip.addClass('fade') var placement = typeof this.options.placement == 'function' ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement var autoToken = /\s?auto?\s?/i var autoPlace = autoToken.test(placement) if (autoPlace) placement = placement.replace(autoToken, '') || 'top' $tip .detach() .css({ top: 0, left: 0, display: 'block' }) .addClass(placement) .data('bs.' + this.type, this) this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) this.$element.trigger('inserted.bs.' + this.type) var pos = this.getPosition() var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight if (autoPlace) { var orgPlacement = placement var viewportDim = this.getPosition(this.$viewport) placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : placement $tip .removeClass(orgPlacement) .addClass(placement) } var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) this.applyPlacement(calculatedOffset, placement) var complete = function () { var prevHoverState = that.hoverState that.$element.trigger('shown.bs.' + that.type) that.hoverState = null if (prevHoverState == 'out') that.leave(that) } $.support.transition && this.$tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete() } } Tooltip.prototype.applyPlacement = function (offset, placement) { var $tip = this.tip() var width = $tip[0].offsetWidth var height = $tip[0].offsetHeight // manually read margins because getBoundingClientRect includes difference var marginTop = parseInt($tip.css('margin-top'), 10) var marginLeft = parseInt($tip.css('margin-left'), 10) // we must check for NaN for ie 8/9 if (isNaN(marginTop)) marginTop = 0 if (isNaN(marginLeft)) marginLeft = 0 offset.top += marginTop offset.left += marginLeft // $.fn.offset doesn't round pixel values // so we use setOffset directly with our own function B-0 $.offset.setOffset($tip[0], $.extend({ using: function (props) { $tip.css({ top: Math.round(props.top), left: Math.round(props.left) }) } }, offset), 0) $tip.addClass('in') // check to see if placing tip in new offset caused the tip to resize itself var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight if (placement == 'top' && actualHeight != height) { offset.top = offset.top + height - actualHeight } var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) if (delta.left) offset.left += delta.left else offset.top += delta.top var isVertical = /top|bottom/.test(placement) var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' $tip.offset(offset) this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) } Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { this.arrow() .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') .css(isVertical ? 'top' : 'left', '') } Tooltip.prototype.setContent = function () { var $tip = this.tip() var title = this.getTitle() $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) $tip.removeClass('fade in top bottom left right') } Tooltip.prototype.hide = function (callback) { var that = this var $tip = $(this.$tip) var e = $.Event('hide.bs.' + this.type) function complete() { if (that.hoverState != 'in') $tip.detach() that.$element .removeAttr('aria-describedby') .trigger('hidden.bs.' + that.type) callback && callback() } this.$element.trigger(e) if (e.isDefaultPrevented()) return $tip.removeClass('in') $.support.transition && $tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete() this.hoverState = null return this } Tooltip.prototype.fixTitle = function () { var $e = this.$element if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') } } Tooltip.prototype.hasContent = function () { return this.getTitle() } Tooltip.prototype.getPosition = function ($element) { $element = $element || this.$element var el = $element[0] var isBody = el.tagName == 'BODY' var elRect = el.getBoundingClientRect() if (elRect.width == null) { // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) } var elOffset = isBody ? { top: 0, left: 0 } : $element.offset() var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null return $.extend({}, elRect, scroll, outerDims, elOffset) } Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } } Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { var delta = { top: 0, left: 0 } if (!this.$viewport) return delta var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 var viewportDimensions = this.getPosition(this.$viewport) if (/right|left/.test(placement)) { var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight if (topEdgeOffset < viewportDimensions.top) { // top overflow delta.top = viewportDimensions.top - topEdgeOffset } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset } } else { var leftEdgeOffset = pos.left - viewportPadding var rightEdgeOffset = pos.left + viewportPadding + actualWidth if (leftEdgeOffset < viewportDimensions.left) { // left overflow delta.left = viewportDimensions.left - leftEdgeOffset } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset } } return delta } Tooltip.prototype.getTitle = function () { var title var $e = this.$element var o = this.options title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) return title } Tooltip.prototype.getUID = function (prefix) { do prefix += ~~(Math.random() * 1000000) while (document.getElementById(prefix)) return prefix } Tooltip.prototype.tip = function () { if (!this.$tip) { this.$tip = $(this.options.template) if (this.$tip.length != 1) { throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') } } return this.$tip } Tooltip.prototype.arrow = function () { return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) } Tooltip.prototype.enable = function () { this.enabled = true } Tooltip.prototype.disable = function () { this.enabled = false } Tooltip.prototype.toggleEnabled = function () { this.enabled = !this.enabled } Tooltip.prototype.toggle = function (e) { var self = this if (e) { self = $(e.currentTarget).data('bs.' + this.type) if (!self) { self = new this.constructor(e.currentTarget, this.getDelegateOptions()) $(e.currentTarget).data('bs.' + this.type, self) } } if (e) { self.inState.click = !self.inState.click if (self.isInStateTrue()) self.enter(self) else self.leave(self) } else { self.tip().hasClass('in') ? self.leave(self) : self.enter(self) } } Tooltip.prototype.destroy = function () { var that = this clearTimeout(this.timeout) this.hide(function () { that.$element.off('.' + that.type).removeData('bs.' + that.type) if (that.$tip) { that.$tip.detach() } that.$tip = null that.$arrow = null that.$viewport = null }) } // TOOLTIP PLUGIN DEFINITION // ========================= function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tooltip') var options = typeof option == 'object' && option if (!data && /destroy|hide/.test(option)) return if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) if (typeof option == 'string') data[option]() }) } var old = $.fn.tooltip $.fn.tooltip = Plugin $.fn.tooltip.Constructor = Tooltip // TOOLTIP NO CONFLICT // =================== $.fn.tooltip.noConflict = function () { $.fn.tooltip = old return this } }(jQuery); /* ======================================================================== * Bootstrap: popover.js v3.3.5 * http://getbootstrap.com/javascript/#popovers * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // POPOVER PUBLIC CLASS DEFINITION // =============================== var Popover = function (element, options) { this.init('popover', element, options) } if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') Popover.VERSION = '3.3.5' Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { placement: 'right', trigger: 'click', content: '', template: '' }) // NOTE: POPOVER EXTENDS tooltip.js // ================================ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) Popover.prototype.constructor = Popover Popover.prototype.getDefaults = function () { return Popover.DEFAULTS } Popover.prototype.setContent = function () { var $tip = this.tip() var title = this.getTitle() var content = this.getContent() $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' ](content) $tip.removeClass('fade top bottom left right in') // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do // this manually by checking the contents. if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() } Popover.prototype.hasContent = function () { return this.getTitle() || this.getContent() } Popover.prototype.getContent = function () { var $e = this.$element var o = this.options return $e.attr('data-content') || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) } Popover.prototype.arrow = function () { return (this.$arrow = this.$arrow || this.tip().find('.arrow')) } // POPOVER PLUGIN DEFINITION // ========================= function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.popover') var options = typeof option == 'object' && option if (!data && /destroy|hide/.test(option)) return if (!data) $this.data('bs.popover', (data = new Popover(this, options))) if (typeof option == 'string') data[option]() }) } var old = $.fn.popover $.fn.popover = Plugin $.fn.popover.Constructor = Popover // POPOVER NO CONFLICT // =================== $.fn.popover.noConflict = function () { $.fn.popover = old return this } }(jQuery); /* ======================================================================== * Bootstrap: scrollspy.js v3.3.5 * http://getbootstrap.com/javascript/#scrollspy * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // SCROLLSPY CLASS DEFINITION // ========================== function ScrollSpy(element, options) { this.$body = $(document.body) this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) this.options = $.extend({}, ScrollSpy.DEFAULTS, options) this.selector = (this.options.target || '') + ' .nav li > a' this.offsets = [] this.targets = [] this.activeTarget = null this.scrollHeight = 0 this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) this.refresh() this.process() } ScrollSpy.VERSION = '3.3.5' ScrollSpy.DEFAULTS = { offset: 10 } ScrollSpy.prototype.getScrollHeight = function () { return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) } ScrollSpy.prototype.refresh = function () { var that = this var offsetMethod = 'offset' var offsetBase = 0 this.offsets = [] this.targets = [] this.scrollHeight = this.getScrollHeight() if (!$.isWindow(this.$scrollElement[0])) { offsetMethod = 'position' offsetBase = this.$scrollElement.scrollTop() } this.$body .find(this.selector) .map(function () { var $el = $(this) var href = $el.data('target') || $el.attr('href') var $href = /^#./.test(href) && $(href) return ($href && $href.length && $href.is(':visible') && [[$href[offsetMethod]().top + offsetBase, href]]) || null }) .sort(function (a, b) { return a[0] - b[0] }) .each(function () { that.offsets.push(this[0]) that.targets.push(this[1]) }) } ScrollSpy.prototype.process = function () { var scrollTop = this.$scrollElement.scrollTop() + this.options.offset var scrollHeight = this.getScrollHeight() var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() var offsets = this.offsets var targets = this.targets var activeTarget = this.activeTarget var i if (this.scrollHeight != scrollHeight) { this.refresh() } if (scrollTop >= maxScroll) { return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) } if (activeTarget && scrollTop < offsets[0]) { this.activeTarget = null return this.clear() } for (i = offsets.length; i--;) { activeTarget != targets[i] && scrollTop >= offsets[i] && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) && this.activate(targets[i]) } } ScrollSpy.prototype.activate = function (target) { this.activeTarget = target this.clear() var selector = this.selector + '[data-target="' + target + '"],' + this.selector + '[href="' + target + '"]' var active = $(selector) .parents('li') .addClass('active') if (active.parent('.dropdown-menu').length) { active = active .closest('li.dropdown') .addClass('active') } active.trigger('activate.bs.scrollspy') } ScrollSpy.prototype.clear = function () { $(this.selector) .parentsUntil(this.options.target, '.active') .removeClass('active') } // SCROLLSPY PLUGIN DEFINITION // =========================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.scrollspy') var options = typeof option == 'object' && option if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) if (typeof option == 'string') data[option]() }) } var old = $.fn.scrollspy $.fn.scrollspy = Plugin $.fn.scrollspy.Constructor = ScrollSpy // SCROLLSPY NO CONFLICT // ===================== $.fn.scrollspy.noConflict = function () { $.fn.scrollspy = old return this } // SCROLLSPY DATA-API // ================== $(window).on('load.bs.scrollspy.data-api', function () { $('[data-spy="scroll"]').each(function () { var $spy = $(this) Plugin.call($spy, $spy.data()) }) }) }(jQuery); /* ======================================================================== * Bootstrap: tab.js v3.3.5 * http://getbootstrap.com/javascript/#tabs * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // TAB CLASS DEFINITION // ==================== var Tab = function (element) { // jscs:disable requireDollarBeforejQueryAssignment this.element = $(element) // jscs:enable requireDollarBeforejQueryAssignment } Tab.VERSION = '3.3.5' Tab.TRANSITION_DURATION = 150 Tab.prototype.show = function () { var $this = this.element var $ul = $this.closest('ul:not(.dropdown-menu)') var selector = $this.data('target') if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } if ($this.parent('li').hasClass('active')) return var $previous = $ul.find('.active:last a') var hideEvent = $.Event('hide.bs.tab', { relatedTarget: $this[0] }) var showEvent = $.Event('show.bs.tab', { relatedTarget: $previous[0] }) $previous.trigger(hideEvent) $this.trigger(showEvent) if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return var $target = $(selector) this.activate($this.closest('li'), $ul) this.activate($target, $target.parent(), function () { $previous.trigger({ type: 'hidden.bs.tab', relatedTarget: $this[0] }) $this.trigger({ type: 'shown.bs.tab', relatedTarget: $previous[0] }) }) } Tab.prototype.activate = function (element, container, callback) { var $active = container.find('> .active') var transition = callback && $.support.transition && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) function next() { $active .removeClass('active') .find('> .dropdown-menu > .active') .removeClass('active') .end() .find('[data-toggle="tab"]') .attr('aria-expanded', false) element .addClass('active') .find('[data-toggle="tab"]') .attr('aria-expanded', true) if (transition) { element[0].offsetWidth // reflow for transition element.addClass('in') } else { element.removeClass('fade') } if (element.parent('.dropdown-menu').length) { element .closest('li.dropdown') .addClass('active') .end() .find('[data-toggle="tab"]') .attr('aria-expanded', true) } callback && callback() } $active.length && transition ? $active .one('bsTransitionEnd', next) .emulateTransitionEnd(Tab.TRANSITION_DURATION) : next() $active.removeClass('in') } // TAB PLUGIN DEFINITION // ===================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tab') if (!data) $this.data('bs.tab', (data = new Tab(this))) if (typeof option == 'string') data[option]() }) } var old = $.fn.tab $.fn.tab = Plugin $.fn.tab.Constructor = Tab // TAB NO CONFLICT // =============== $.fn.tab.noConflict = function () { $.fn.tab = old return this } // TAB DATA-API // ============ var clickHandler = function (e) { e.preventDefault() Plugin.call($(this), 'show') } $(document) .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) }(jQuery); /* ======================================================================== * Bootstrap: affix.js v3.3.5 * http://getbootstrap.com/javascript/#affix * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // AFFIX CLASS DEFINITION // ====================== var Affix = function (element, options) { this.options = $.extend({}, Affix.DEFAULTS, options) this.$target = $(this.options.target) .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) this.$element = $(element) this.affixed = null this.unpin = null this.pinnedOffset = null this.checkPosition() } Affix.VERSION = '3.3.5' Affix.RESET = 'affix affix-top affix-bottom' Affix.DEFAULTS = { offset: 0, target: window } Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { var scrollTop = this.$target.scrollTop() var position = this.$element.offset() var targetHeight = this.$target.height() if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false if (this.affixed == 'bottom') { if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' } var initializing = this.affixed == null var colliderTop = initializing ? scrollTop : position.top var colliderHeight = initializing ? targetHeight : height if (offsetTop != null && scrollTop <= offsetTop) return 'top' if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' return false } Affix.prototype.getPinnedOffset = function () { if (this.pinnedOffset) return this.pinnedOffset this.$element.removeClass(Affix.RESET).addClass('affix') var scrollTop = this.$target.scrollTop() var position = this.$element.offset() return (this.pinnedOffset = position.top - scrollTop) } Affix.prototype.checkPositionWithEventLoop = function () { setTimeout($.proxy(this.checkPosition, this), 1) } Affix.prototype.checkPosition = function () { if (!this.$element.is(':visible')) return var height = this.$element.height() var offset = this.options.offset var offsetTop = offset.top var offsetBottom = offset.bottom var scrollHeight = Math.max($(document).height(), $(document.body).height()) if (typeof offset != 'object') offsetBottom = offsetTop = offset if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) if (this.affixed != affix) { if (this.unpin != null) this.$element.css('top', '') var affixType = 'affix' + (affix ? '-' + affix : '') var e = $.Event(affixType + '.bs.affix') this.$element.trigger(e) if (e.isDefaultPrevented()) return this.affixed = affix this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null this.$element .removeClass(Affix.RESET) .addClass(affixType) .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') } if (affix == 'bottom') { this.$element.offset({ top: scrollHeight - height - offsetBottom }) } } // AFFIX PLUGIN DEFINITION // ======================= function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.affix') var options = typeof option == 'object' && option if (!data) $this.data('bs.affix', (data = new Affix(this, options))) if (typeof option == 'string') data[option]() }) } var old = $.fn.affix $.fn.affix = Plugin $.fn.affix.Constructor = Affix // AFFIX NO CONFLICT // ================= $.fn.affix.noConflict = function () { $.fn.affix = old return this } // AFFIX DATA-API // ============== $(window).on('load', function () { $('[data-spy="affix"]').each(function () { var $spy = $(this) var data = $spy.data() data.offset = data.offset || {} if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom if (data.offsetTop != null) data.offset.top = data.offsetTop Plugin.call($spy, data) }) }) }(jQuery); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/.bower.json ================================================ { "name": "jquery-validation", "homepage": "http://jqueryvalidation.org/", "repository": { "type": "git", "url": "git://github.com/jzaefferer/jquery-validation.git" }, "authors": [ "Jörn Zaefferer " ], "description": "Form validation made easy", "main": "dist/jquery.validate.js", "keywords": [ "forms", "validation", "validate" ], "license": "MIT", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "demo", "lib" ], "dependencies": { "jquery": ">= 1.7.2" }, "version": "1.14.0", "_release": "1.14.0", "_resolution": { "type": "version", "tag": "1.14.0", "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" }, "_source": "https://github.com/jzaefferer/jquery-validation.git", "_target": "1.14.0", "_originalSource": "jquery-validation" } ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/CONTRIBUTING.md ================================================ # Contributing to the jQuery Validation Plugin ## Reporting an Issue 1. Make sure the problem you're addressing is reproducible. 2. Use http://jsbin.com or http://jsfiddle.net to provide a test page. 3. Indicate what browsers the issue can be reproduced in. **Note: IE Compatibilty mode issues will not be addressed. Make sure you test in a real browser!** 4. What version of the plug-in is the issue reproducible in. Is it reproducible after updating to the latest version. Documentation issues are also tracked at the [jQuery Validation](https://github.com/jzaefferer/jquery-validation/issues) issue tracker. Pull Requests to improve the docs are welcome at the [jQuery Validation docs](https://github.com/jzaefferer/validation-content) repository, though. **IMPORTANT NOTE ABOUT EMAIL VALIDATION**. As of version 1.12.0 this plugin is using the same regular expression that the [HTML5 specification suggests for browsers to use](https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address). We will follow their lead and use the same check. If you think the specification is wrong, please report the issue to them. If you have different requirements, consider [using a custom method](http://jqueryvalidation.org/jQuery.validator.addMethod/). ## Contributing code Thanks for contributing! Here's a few guidelines to help your contribution get landed. 1. Make sure the problem you're addressing is reproducible. Use jsbin.com or jsfiddle.net to provide a test page. 2. Follow the [jQuery style guide](http://contribute.jquery.com/style-guides/js) 3. Add or update unit tests along with your patch. Run the unit tests in at least one browser (see below). 4. Run `grunt` (see below) to check for linting and a few other issues. 5. Describe the change in your commit message and reference the ticket, like this: "Demos: Fixed delegate bug for dynamic-totals demo. Fixes #51". If you're adding a new localization file, use something like this: "Localization: Added croatian (HR) localization" ## Build setup 1. Install [NodeJS](http://nodejs.org). 2. Install the Grunt CLI To install by running `npm install -g grunt-cli`. More details are available on their website http://gruntjs.com/getting-started. 3. Install the NPM dependencies by running `npm install`. 4. The build can now be called by running `grunt`. ## Creating a new Additional Method If you've wrote custom methods that you'd like to contribute to additional-methods.js: 1. Create a branch 2. Add the method as a new file in `src/additional` 3. (Optional) Add translations to `src/localization` 4. Send a pull request to the master branch. ## Unit Tests To run unit tests, just open `test/index.html` within your browser. Make sure you ran `npm install` before so all required dependencies are available. Start with one browser while developing the fix, then run against others before committing. Usually latest Chrome, Firefox, Safari and Opera and a few IEs. ## Documentation Please report documentation issues at the [jQuery Validation](https://github.com/jzaefferer/jquery-validation/issues) issue tracker. In case your pull request implements or changes public API it would be a plus you would provide a pull request against the [jQuery Validation docs](https://github.com/jzaefferer/validation-content) repository. ## Linting To run JSHint and other tools, use `grunt`. ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/Gruntfile.js ================================================ /*jshint node:true*/ module.exports = function(grunt) { "use strict"; var banner, umdStart, umdMiddle, umdEnd, umdStandardDefine, umdAdditionalDefine, umdLocalizationDefine; banner = "/*!\n" + " * jQuery Validation Plugin v<%= pkg.version %>\n" + " *\n" + " * <%= pkg.homepage %>\n" + " *\n" + " * Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>\n" + " * Released under the <%= _.pluck(pkg.licenses, 'type').join(', ') %> license\n" + " */\n"; // define UMD wrapper variables umdStart = "(function( factory ) {\n" + "\tif ( typeof define === \"function\" && define.amd ) {\n"; umdMiddle = "\t} else {\n" + "\t\tfactory( jQuery );\n" + "\t}\n" + "}(function( $ ) {\n\n"; umdEnd = "\n}));"; umdStandardDefine = "\t\tdefine( [\"jquery\"], factory );\n"; umdAdditionalDefine = "\t\tdefine( [\"jquery\", \"./jquery.validate\"], factory );\n"; umdLocalizationDefine = "\t\tdefine( [\"jquery\", \"../jquery.validate\"], factory );\n"; grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), concat: { // used to copy to dist folder dist: { options: { banner: banner + umdStart + umdStandardDefine + umdMiddle, footer: umdEnd }, files: { "dist/jquery.validate.js": [ "src/core.js", "src/*.js" ] } }, extra: { options: { banner: banner + umdStart + umdAdditionalDefine + umdMiddle, footer: umdEnd }, files: { "dist/additional-methods.js": [ "src/additional/additional.js", "src/additional/*.js" ] } } }, uglify: { options: { preserveComments: false, banner: "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " + "<%= grunt.template.today('m/d/yyyy') %>\n" + " * <%= pkg.homepage %>\n" + " * Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" + " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n" }, dist: { files: { "dist/additional-methods.min.js": "dist/additional-methods.js", "dist/jquery.validate.min.js": "dist/jquery.validate.js" } }, all: { expand: true, cwd: "dist/localization", src: "**/*.js", dest: "dist/localization", ext: ".min.js" } }, compress: { dist: { options: { mode: "zip", level: 1, archive: "dist/<%= pkg.name %>-<%= pkg.version %>.zip", pretty: true }, src: [ "changelog.txt", "demo/**/*.*", "dist/**/*.js", "Gruntfile.js", "lib/**/*.*", "package.json", "README.md", "src/**/*.*", "test/**/*.*" ] } }, qunit: { files: "test/index.html" }, jshint: { options: { jshintrc: true }, core: { src: "src/**/*.js" }, test: { src: "test/*.js" }, grunt: { src: "Gruntfile.js" } }, watch: { options: { atBegin: true }, src: { files: "<%= jshint.core.src %>", tasks: [ "concat" ] } }, jscs: { all: [ "<%= jshint.core.src %>", "<%= jshint.test.src %>", "<%= jshint.grunt.src %>" ] }, copy: { dist: { options: { // append UMD wrapper process: function( content ) { return umdStart + umdLocalizationDefine + umdMiddle + content + umdEnd; } }, src: "src/localization/*", dest: "dist/localization", expand: true, flatten: true, filter: "isFile" } }, replace: { dist: { src: "dist/**/*.min.js", overwrite: true, replacements: [ { from: "./jquery.validate", to: "./jquery.validate.min" } ] } } }); grunt.loadNpmTasks("grunt-contrib-jshint"); grunt.loadNpmTasks("grunt-contrib-qunit"); grunt.loadNpmTasks("grunt-contrib-uglify"); grunt.loadNpmTasks("grunt-contrib-concat"); grunt.loadNpmTasks("grunt-contrib-compress"); grunt.loadNpmTasks("grunt-contrib-watch"); grunt.loadNpmTasks("grunt-jscs"); grunt.loadNpmTasks("grunt-contrib-copy"); grunt.loadNpmTasks("grunt-text-replace"); grunt.registerTask("default", [ "concat", "copy", "jscs", "jshint", "qunit" ]); grunt.registerTask("release", [ "default", "uglify", "replace", "compress" ]); grunt.registerTask("start", [ "concat", "watch" ]); }; ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/LICENSE.md ================================================ The MIT License (MIT) ===================== Copyright Jörn Zaefferer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/README.md ================================================ [jQuery Validation Plugin](http://jqueryvalidation.org/) - Form validation made easy ================================ [![Build Status](https://secure.travis-ci.org/jzaefferer/jquery-validation.png)](http://travis-ci.org/jzaefferer/jquery-validation) [![devDependency Status](https://david-dm.org/jzaefferer/jquery-validation/dev-status.png?theme=shields.io)](https://david-dm.org/jzaefferer/jquery-validation#info=devDependencies) The jQuery Validation Plugin provides drop-in validation for your existing forms, while making all kinds of customizations to fit your application really easy. ## [Help the project](http://pledgie.com/campaigns/18159) [![Help the project](http://www.pledgie.com/campaigns/18159.png?skin_name=chrome)](http://pledgie.com/campaigns/18159) This project is looking for help! [You can donate to the ongoing pledgie campaign](http://pledgie.com/campaigns/18159) and help spread the word. If you've used the plugin, or plan to use, consider a donation - any amount will help. You can find the plan for how to spend the money on the [pledgie page](http://pledgie.com/campaigns/18159). ## Getting Started ### Downloading the prebuilt files Prebuilt files can be downloaded from http://jqueryvalidation.org/ ### Downloading the latest changes The unreleased development files can be obtained by: 1. [Downloading](https://github.com/jzaefferer/jquery-validation/archive/master.zip) or Forking this repository 2. [Setup the build](CONTRIBUTING.md#build-setup) 3. Run `grunt` to create the built files in the "dist" directory ### Including it on your page Include jQuery and the plugin on a page. Then select a form to validate and call the `validate` method. ```html
    ``` Alternatively include jQuery and the plugin via requirejs in your module. ```js define(["jquery", "jquery.validate"], function( $ ) { $("form").validate(); }); ``` For more information on how to setup a rules and customizations, [check the documentation](http://jqueryvalidation.org/documentation/). ## Reporting issues and contributing code See the [Contributing Guidelines](CONTRIBUTING.md) for details. **IMPORTANT NOTE ABOUT EMAIL VALIDATION**. As of version 1.12.0 this plugin is using the same regular expression that the [HTML5 specification suggests for browsers to use](https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address). We will follow their lead and use the same check. If you think the specification is wrong, please report the issue to them. If you have different requirements, consider [using a custom method](http://jqueryvalidation.org/jQuery.validator.addMethod/). ## License Copyright © Jörn Zaefferer
    Licensed under the MIT license. ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/bower.json ================================================ { "name": "jquery-validation", "homepage": "http://jqueryvalidation.org/", "repository": { "type": "git", "url": "git://github.com/jzaefferer/jquery-validation.git" }, "authors": [ "Jörn Zaefferer " ], "description": "Form validation made easy", "main": "dist/jquery.validate.js", "keywords": [ "forms", "validation", "validate" ], "license": "MIT", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "demo", "lib" ], "dependencies": { "jquery": ">= 1.7.2" }, "version": "1.14.0" } ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/changelog.md ================================================ 1.14.0 / 2015-06-30 ================== ## Core * Remove unused removeAttrs method * Replace regex for url method * Remove bad url param in $.ajax, overwritten by $.extend * Properly handle nested cancel submit button * Fix indent * Refactor attributeRules and dataRules to share noramlizer * dataRules method to convert value to number for number inputs * Update url method to allow for protocol-relative URLs * Remove deprecated $.format placeholder * Use jQuery 1.7+ on/off, add destroy method * IE8 compatibility changed .indexOf to $.inArray * Cast NaN value attributes to undefined for Opera Mini * Stop trimming value inside required method * Use :disabled selector to match disabled elements * Exclude some keyboard keys to prevent revalidating the field * Do not search the whole DOM for radio/checkbox elements * Throw better errors for bad rule methods * Fixed number validation error * Fix reference to whatwg spec * Focus invalid element when validating a custom set of inputs * Reset element styles when using custom highlight methods * Escape dollar sign in error id * Revert "Ignore readonly as well as disabled fields." * Update link in comment for Luhn algorithm ## Additionals * Update dateITA to address timezone issue * Fix extension method to only method period * Fix accept method to match period only * Update time method to allow single digit hour * Drop bad test for notEqualTo method * Add notEqualTo method * Use correct jQuery reference via `$` * Remove useless regex check in iban method * Brazilian CPF number ## Localization * Update messages_tr.js * Update messages_sr_lat.js * Adding Perú Spanish (ES PE) * Adding Georgian (ქართული, ge) * Fixed typo in catalan translation * Improve Finnish (fi) translation * Add armenian (hy_AM) locale * Extend italian (it) translation with currency method * Add bn_BD locale * Update zh locale * Remove full stop at the end of italian messages 1.13.1 / 2014-10-14 ================== ## Core * Allow 0 as value for autoCreateRanges * Apply ignore setting to all validationTargetFor elements * Don't trim value in min/max/rangelength methods * Escape id/name before using it as a selector in errorsFor * Explicit default for focusCleanup option * Fix incorrect regexp for describedby matcher * Ignore readonly as well as disabled fields * Improve id escaping, store escaped id in describedby * Use return value of submitHandler to allow or prevent form submit ## Additionals * Add postalcodeBR method * Fix pattern method when parameter is a string 1.13.0 / 2014-07-01 ================== ## All * Add plugin UMD wrapper ## Core * Respect non-error aria-describedby and empty hidden errors * Improve dateISO RegExp * Added radio/checkbox to delegate click-event * Use aria-describedby for non-label elements * Register focusin, focusout and keyup also on radio/checkbox * Fix normalization for rangelength attribute value * Update elementValue method to deal with type="number" fields * Use charAt instead of array notation on strings, to support IE8(?) ## Localization * Fix sk translation of rangelength method * Add Finnish methods * Fixed GL number validation message * Fixed ES number method validation message * Added galician (GL) * Fixed French messages for min and max methods ## Additionals * Add statesUS method * Fix dateITA method to deal with DST bug * Add persian date method * Add postalCodeCA method * Add postalcodeIT method 1.12.0 / 2014-04-01 ================== * Add ARIA testing ([3d5658e](https://github.com/jzaefferer/jquery-validation/commit/3d5658e9e4825fab27198c256beed86f0bd12577)) * Add es-AR localization messages. ([7b30beb](https://github.com/jzaefferer/jquery-validation/commit/7b30beb8ebd218c38a55d26a63d529e16035c7a2)) * Add missing dots to 'es' and 'es_AR' messages. ([a2a653c](https://github.com/jzaefferer/jquery-validation/commit/a2a653cb68926ca034b4b09d742d275db934d040)) * Added Indonesian (ID) localization ([1d348bd](https://github.com/jzaefferer/jquery-validation/commit/1d348bdcb65807c71da8d0bfc13a97663631cd3a)) * Added NIF, NIE and CIF Spanish documents numbers validation ([#830](https://github.com/jzaefferer/jquery-validation/issues/830), [317c20f](https://github.com/jzaefferer/jquery-validation/commit/317c20fa9bb772770bb9b70d46c7081d7cfc6545)) * Added the current form to the context of the remote ajax request ([0a18ae6](https://github.com/jzaefferer/jquery-validation/commit/0a18ae65b9b6d877e3d15650a5c2617a9d2b11d5)) * Additionals: Update IBAN method, trim trailing whitespaces ([#970](https://github.com/jzaefferer/jquery-validation/issues/970), [347b04a](https://github.com/jzaefferer/jquery-validation/commit/347b04a7d4e798227405246a5de3fc57451d52e1)) * BIC method: Improve RegEx, {1} is always redundant. Closes gh-744 ([5cad6b4](https://github.com/jzaefferer/jquery-validation/commit/5cad6b493575e8a9a82470d17e0900c881130873)) * Bower: Add Bower.json for package registration ([e86ccb0](https://github.com/jzaefferer/jquery-validation/commit/e86ccb06e301613172d472cf15dd4011ff71b398)) * Changes dollar references to 'jQuery', for compability with jQuery.noConflict. Closes gh-754 ([2049afe](https://github.com/jzaefferer/jquery-validation/commit/2049afe46c1be7b3b89b1d9f0690f5bebf4fbf68)) * Core: Add "method" field to error list entry ([89a15c7](https://github.com/jzaefferer/jquery-validation/commit/89a15c7a4b17fa2caaf4ff817f09b04c094c3884)) * Core: Added support for generic messages via data-msg attribute ([5bebaa5](https://github.com/jzaefferer/jquery-validation/commit/5bebaa5c55c73f457c0e0181ec4e3b0c409e2a9d)) * Core: Allow attributes to have a value of zero (eg min='0') ([#854](https://github.com/jzaefferer/jquery-validation/issues/854), [9dc0d1d](https://github.com/jzaefferer/jquery-validation/commit/9dc0d1dd946b2c6178991fb16df0223c76162579)) * Core: Disable deprecated $.format ([#755](https://github.com/jzaefferer/jquery-validation/issues/755), [bf3b350](https://github.com/jzaefferer/jquery-validation/commit/bf3b3509140ea8ab5d83d3ec58fd9f1d7822efc5)) * Core: Fix support for multiple error classes ([c1f0baf](https://github.com/jzaefferer/jquery-validation/commit/c1f0baf36c21ca175bbc05fb9345e5b44b094821)) * Core: Ignore events on ignored elements ([#700](https://github.com/jzaefferer/jquery-validation/issues/700), [a864211](https://github.com/jzaefferer/jquery-validation/commit/a86421131ea69786ee9e0d23a68a54a7658ccdbf)) * Core: Improve elementValue method ([6c041ed](https://github.com/jzaefferer/jquery-validation/commit/6c041edd21af1425d12d06cdd1e6e32a78263e82)) * Core: Make element() handle ignored elements properly. ([3f464a8](https://github.com/jzaefferer/jquery-validation/commit/3f464a8da49dbb0e4881ada04165668e4a63cecb)) * Core: Switch dataRules parsing to W3C HTML5 spec style ([460fd22](https://github.com/jzaefferer/jquery-validation/commit/460fd22b6c84a74c825ce1fa860c0a9da20b56bb)) * Core: Trigger success on optional but have other successful validators ([#851](https://github.com/jzaefferer/jquery-validation/issues/851), [f93e1de](https://github.com/jzaefferer/jquery-validation/commit/f93e1deb48ec8b3a8a54e946a37db2de42d3aa2a)) * Core: Use plain element instead of un-wrapping the element again ([03cd4c9](https://github.com/jzaefferer/jquery-validation/commit/03cd4c93069674db5415a0bf174a5870da47e5d2)) * Core: make sure remote is executed last ([#711](https://github.com/jzaefferer/jquery-validation/issues/711), [ad91b6f](https://github.com/jzaefferer/jquery-validation/commit/ad91b6f388b7fdfb03b74e78554cbab9fd8fca6f)) * Demo: Use correct option in multipart demo. ([#1025](https://github.com/jzaefferer/jquery-validation/issues/1025), [070edc7](https://github.com/jzaefferer/jquery-validation/commit/070edc7be4de564cb74cfa9ee4e3f40b6b70b76f)) * Fix $/jQuery usage in additional methods. Fixes #839 ([#839](https://github.com/jzaefferer/jquery-validation/issues/839), [59bc899](https://github.com/jzaefferer/jquery-validation/commit/59bc899e4586255a4251903712e813c21d25b3e1)) * Improve Chinese translations ([1a0bfe3](https://github.com/jzaefferer/jquery-validation/commit/1a0bfe32b16f8912ddb57388882aa880fab04ffe)) * Initial ARIA-Required implementation ([bf3cfb2](https://github.com/jzaefferer/jquery-validation/commit/bf3cfb234ede2891d3f7e19df02894797dd7ba5e)) * Localization: change accept values to extension. Fixes #771, closes gh-793. ([#771](https://github.com/jzaefferer/jquery-validation/issues/771), [12edec6](https://github.com/jzaefferer/jquery-validation/commit/12edec66eb30dc7e86756222d455d49b34016f65)) * Messages: Add icelandic localization ([dc88575](https://github.com/jzaefferer/jquery-validation/commit/dc885753c8872044b0eaa1713cecd94c19d4c73d)) * Messages: Add missing dots to 'bg', 'fr' and 'sr' messages. ([adbc636](https://github.com/jzaefferer/jquery-validation/commit/adbc6361c377bf6b74c35df9782479b1115fbad7)) * Messages: Create messages_sr_lat.js ([f2f9007](https://github.com/jzaefferer/jquery-validation/commit/f2f90076518014d98495c2a9afb9a35d45d184e6)) * Messages: Create messages_tj.js ([de830b3](https://github.com/jzaefferer/jquery-validation/commit/de830b3fd8689a7384656c17565ee92c2878d8a5)) * Messages: Fix sr_lat translation, add missing space ([880ba1c](https://github.com/jzaefferer/jquery-validation/commit/880ba1ca545903a41d8c5332fc4038a7e9a580bd)) * Messages: Update messages_sr.js, fix missing space ([10313f4](https://github.com/jzaefferer/jquery-validation/commit/10313f418c18ea75f385248468c2d3600f136cfb)) * Methods: Add additional method for currency ([1a981b4](https://github.com/jzaefferer/jquery-validation/commit/1a981b440346620964c87ebdd0fa03246348390e)) * Methods: Adding Smart Quotes to stripHTML's punctuation removal ([aa0d624](https://github.com/jzaefferer/jquery-validation/commit/aa0d6241c3ea04663edc1e45ed6e6134630bdd2f)) * Methods: Fix dateITA method, avoiding summertime errors ([279b932](https://github.com/jzaefferer/jquery-validation/commit/279b932c1267b7238e6652880b7846ba3bbd2084)) * Methods: Localized methods for chilean culture (es-CL) ([cf36b93](https://github.com/jzaefferer/jquery-validation/commit/cf36b933499e435196d951401221d533a4811810)) * Methods: Update email to use HTML5 regex, remove email2 method ([#828](https://github.com/jzaefferer/jquery-validation/issues/828), [dd162ae](https://github.com/jzaefferer/jquery-validation/commit/dd162ae360639f73edd2dcf7a256710b2f5a4e64)) * Pattern method: Remove delimiters, since HTML5 implementations don't include those either. ([37992c1](https://github.com/jzaefferer/jquery-validation/commit/37992c1c9e2e0be8b315ccccc2acb74863439d3e)) * Restricting credit card validator to include length check. Closes gh-772 ([f5f47c5](https://github.com/jzaefferer/jquery-validation/commit/f5f47c5c661da5b0c0c6d59d169e82230928a804)) * Update messages_ko.js - closes gh-715 ([5da3085](https://github.com/jzaefferer/jquery-validation/commit/5da3085ff02e0e6ecc955a8bfc3bb9a8d220581b)) * Update messages_pt_BR.js. Closes gh-782 ([4bf813b](https://github.com/jzaefferer/jquery-validation/commit/4bf813b751ce34fac3c04eaa2e80f75da3461124)) * Update phonesUK and mobileUK to accept new prefixes. Closes gh-750 ([d447b41](https://github.com/jzaefferer/jquery-validation/commit/d447b41b830dee984be21d8281ec7b87a852001d)) * Verify nine-digit zip codes. Closes gh-726 ([165005d](https://github.com/jzaefferer/jquery-validation/commit/165005d4b5780e22d13d13189d107940c622a76f)) * phoneUS: Add N11 exclusions. Closes gh-861 ([519bbc6](https://github.com/jzaefferer/jquery-validation/commit/519bbc656bcb26e8aae5166d7b2e000014e0d12a)) * resetForm should clear any aria-invalid values ([4f8a631](https://github.com/jzaefferer/jquery-validation/commit/4f8a631cbe84f496ec66260ada52db2aa0bb3733)) * valid(): Check all elements. Fixes #791 - valid() validates only the first (invalid) element ([#791](https://github.com/jzaefferer/jquery-validation/issues/791), [6f26803](https://github.com/jzaefferer/jquery-validation/commit/6f268031afaf4e155424ee74dd11f6c47fbb8553)) 1.11.1 / 2013-03-22 ================== * Revert to also converting parameters of range method to numbers. Closes gh-702 * Replace most usage of PHP with mockjax handlers. Do some demo cleanup as well, update to newer masked-input plugin. Keep captcha demo in PHP. Fixes #662 * Remove inline code highlighting from milk demo. View source works fine. * Fix dynamic-totals demo by trimming whitespace from template content before passing to jQuery constructor * Fix min/max validation. Closes gh-666. Fixes #648 * Fixed 'messages' coming up as a rule and causing an exception after being updated through rules("add"). Closes gh-670, fixes #624 * Add Korean (ko) localization. Closes gh-671 * Improved the UK postcode method to filter out more invalid postcodes. Closes #682 * Update messages_sv.js. Closes #683 * Change grunt link to the project website. Closes #684 * Move remote method down the list to run last, after all other methods applied to a field. Fixes #679 * Update plugin.json description, should include the word 'validate' * Fix typos * Fix jQuery loader to use path of itself. Fixes nested demos. * Update grunt-contrib-qunit to make use of PhantomJS 1.8, when installed through node module 'phantomjs' * Make valid() return a boolean instead of 0 or 1. Fixes #109 - valid() does not return boolean value 1.11.0 / 2013-02-04 ================== * Remove clearing as numbers of `min`, `max` and `range` rules. Fixes #455. Closes gh-528. * Update pre-existing labels - fixes #430 closes gh-436 * Fix $.validator.format to avoid group interpolation, where at least IE8/9 replaces -bash with the match. Fixes #614 * Fix mimetype regex * Add plugin manifest and update headers to just MIT license, drop unnecessary dual-licensing (like jQuery). * Hebrew messages: Removed dots at end of sentences - Fixes gh-568 * French translation for require_from_group validation. Fixes gh-573. * Allow groups to be an array or a string - Fixes #479 * Removed spaces with multiple MIME types * Fix some date validations, JS syntax errors. * Remove support for metadata plugin, replace with data-rule- and data-msg- (added in 907467e8) properties. * Added sftp as a valid url-pattern * Add Malay (my) localization * Update localization/messages_hu.js * Remove focusin/focusout polyfill. Fixes #542 - Inclusion of jquery.validate interfers with focusin and focusout events in IE9 * Localization: Fixed typo in finnish translation * Fix RTM demo to show invalid icon when going from valid back to invalid * Fixed premature return in remote function which prevented ajax call from being made in case an input was entered too quickly. Ensures remote validation always validates the newest value. * Undo fix for #244. Fixes #521 - E-mail validation fires immediately when text is in the field. 1.10.0 / 2012-09-07 =================== * Corrected French strings for nowhitespace, phoneUS, phoneUK and mobileUK based upon community feedback. * rename files for language_REGION according to the standard ISO_3166-1 (http://en.wikipedia.org/wiki/ISO_3166-1), for Taiwan tha language is Chinese (zh) and the region is Taiwan (TW) * Optimise RegEx patterns, especially for UK phone numbers. * Add Language Name for each file, rename the language code according to the standard ISO 639 for Estonian, Georgian, Ukrainian and Chinese (http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) * Added croatian (HR) localization * Existing French translations were edited and French translations for the additional methods were added. * Merged in changes for specifying custom error messages in data attributes * Updated UK Mobile phone number regex for new numbers. Fixes #154 * Add element to success call with test. Fixes #60 * Fixed regex for time additional method. Fixes #131 * resetForm now clears old previousValue on form elements. Fixes #312 * Added checkbox test to require_from_group and changed require_from_group to use elementValue. Fixes #359 * Fixed dataFilter response issues in jQuery 1.5.2+. Fixes #405 * Added jQuery Mobile demo. Fixes #249 * Deoptimize findByName for correctness. Fixes #82 - $.validator.prototype.findByName breaks in IE7 * Added US zip code support and test. Fixes #90 * Changed lastElement to lastActive in keyup, skip validation on tab or empty element. Fixes #244 * Removed number stripping from stripHtml. Fixes #2 * Fixed invalid count on invalid to valid remote validation. Fixes #286 * Add link to file_input to demo index * Moved old accept method to extension additional-method, added new accept method to handle standard browser mimetype filtering. Fixes #287 and supersedes #369 * Disables blur event when onfocusout is set to false. Test added. * Fixed value issue for radio buttons and checkboxes. Fixes #363 * Added test for rangeWords and fixed regex and bounds in method. Fixes #308 * Fixed TinyMCE Demo and added link on demo page. Fixes #382 * Changed localization message for min/max. Fixes #273 * Added pseudo selector for text input types to fix issue with default empty type attribute. Added tests and some test markup. Fixes #217 * Fixed delegate bug for dynamic-totals demo. Fixes #51 * Fix incorrect message for alphanumeric validator * Removed incorrect false check on required attribute * required attribute fix for non-html5 browsers. Fixes #301 * Added methods "require_from_group" and "skip_or_fill_minimum" * Use correct iso code for swedish * Updated demo HTML files to use HTML5 doctype * Fixed regex issue for decimals without leading zeroes. Added new methods test. Fixes #41 * Introduce a elementValue method that normalizes only string values (don't touch array value of multi-select). Fixes #116 * Support for dynamically added submit buttons, and updated test case. Uses validateDelegate. Code from PR #9 * Fix bad double quote in test fixtures * Fix maxWords method to include the upper bound, not exclude it. Fixes #284 * Fixed grammar error in german range validator message. Fixes #315 * Fixed handling of multiple class names for errorClass option. Test by Max Lynch. Fixes #280 * Fix jQuery.format usage, should be $.validator.format. Fixes #329 * Methods for 'all' UK phone numbers + UK postcodes * Pattern method: Convert string param to RegExp. Fixes issue #223 * grammar error in german localization file * Added Estonian localization for messages * Improve tooltip handling on themerollered demo * Add type="text" to input fields without type attribute to please qSA * Update themerollered demo to use tooltip to show errors as overlay. * Update themerollered demo to use latest jQuery UI (along with newer jQuery version). Move code around to speed up page load. * Fixed min error message broken in Japanese. * Update form plugin to latest version. Enhance the ajaxSubmit demo. * Drop dateDE and numberDE methods from classRuleSettings, leftover from moving those to localized methods * Passing submit event to submitHandler callback * Fixed #219 - Fix valid() on elements with dependency-callback or dependency-expression. * Improve build to remove dist dir to ensure only the current release gets zipped up 1.9.0 --- * Added Basque (EU) localization * Added Slovenian (SL) localization * Fixed issue #127 - Finnish translations has one : instead of ; * Fixed Russian localization, minor syntax issue * Added in support for HTML5 input types, fixes #97 * Improved HTML5 support by setting novalidate attribute on the form, and reading the type attribute. * Fixed showLabel() removing all classes from error element. Remove only settings.validClass. Fixes #151. * Added 'pattern' to additional-methods to validate against arbitrary regular expressions. * Improved email method to not allow the dot at the end (valid by RFC, but unwanted here). Fixes #143 * Fixed swedish and norwegian translations, min/max messages got switched. Fixes #181 * Fixed #184 - resetForm: should unset lastElement * Fixed #71 - improve existing time method and add time12h method for 12h am/pm time format * Fixed #177 - Fix validation of a single radio or checkbox input * Fixed #189 - :hidden elements are now ignored by default * Fixed #194 - Required as attribute fails if jQuery>=1.6 - Use .prop instead of .attr * Fixed #47, #39, #32 - Allowed credit card numbers to contain spaces as well as dashes (spaces are commonly input by users). 1.8.1 --- * Added Thai (TH) localization, fixes #85 * Added Vietnamese (VI) localization, thanks Ngoc * Fixed issue #78. Error/Valid styling applies to all radio buttons of same group for required validation. * Don't use form.elements as that isn't supported in jQuery 1.6 anymore. Its buggy as hell anyway (IE6-8: form.elements === form). 1.8.0 --- * Improved NL localization (http://plugins.jquery.com/node/14120) * Added Georgian (GE) localization, thanks Avtandil Kikabidze * Added Serbian (SR) localization, thanks Aleksandar Milovac * Added ipv4 and ipv6 to additional methods, thanks Natal Ngétal * Added Japanese (JA) localization, thanks Bryan Meyerovich * Added Catalan (CA) localization, thanks Xavier de Pedro * Fixed missing var statements within for-in loops * Fix for remote validation, where a formatted message got messed up (https://github.com/jzaefferer/jquery-validation/issues/11) * Bugfixes for compatibility with jQuery 1.5.1, while maintaining backwards-compatibility 1.7 --- * Added Lithuanian (LT) localization * Added Greek (EL) localization (http://plugins.jquery.com/node/12319) * Added Latvian (LV) localization (http://plugins.jquery.com/node/12349) * Added Hebrew (HE) localization (http://plugins.jquery.com/node/12039) * Fixed Spanish (ES) localization (http://plugins.jquery.com/node/12696) * Added jQuery UI themerolled demo * Removed cmxform.js * Fixed four missing semicolons (http://plugins.jquery.com/node/12639) * Renamed phone-method in additional-methods.js to phoneUS * Added phoneUK and mobileUK methods to additional-methods.js (http://plugins.jquery.com/node/12359) * Deep extend options to avoid modifying multiple forms when using the rules-method on a single element (http://plugins.jquery.com/node/12411) * Bugfixes for compatibility with jQuery 1.4.2, while maintaining backwards-compatibility 1.6 --- * Added Arabic (AR), Portuguese (PTPT), Persian (FA), Finnish (FI) and Bulgarian (BR) localization * Updated Swedish (SE) localization (some missing html iso characters) * Fixed $.validator.addMethod to properly handle empty string vs. undefined for the message argument * Fixed two accidental global variables * Enhanced min/max/rangeWords (in additional-methods.js) to strip html before counting; good when counting words in a richtext editor * Added localized methods for DE, NL and PT, removing the dateDE and numberDE methods (use messages_de.js and methods_de.js with date and number methods instead) * Fixed remote form submit synchronization, kudos to Matas Petrikas * Improved interactive select validation, now validating also on click (via option or select, inconsistent across browsers); doesn't work in Safari, which doesn't trigger a click event at all on select elements; fixes http://plugins.jquery.com/node/11520 * Updated to latest form plugin (2.36), fixing http://plugins.jquery.com/node/11487 * Bind to blur event for equalTo target to revalidate when that target changes, fixes http://plugins.jquery.com/node/11450 * Simplified select validation, delegating to jQuery's val() method to get the select value; should fix http://plugins.jquery.com/node/11239 * Fixed default message for digits (http://plugins.jquery.com/node/9853) * Fixed issue with cached remote message (http://plugins.jquery.com/node/11029 and http://plugins.jquery.com/node/9351) * Fixed a missing semicolon in additional-methods.js (http://plugins.jquery.com/node/9233) * Added automatic detection of substitution parameters in messages, removing the need to provide format functions (http://plugins.jquery.com/node/11195) * Fixed an issue with :filled/:blank somewhat caused by Sizzle (http://plugins.jquery.com/node/11144) * Added an integer method to additional-methods.js (http://plugins.jquery.com/node/9612) * Fixed errorsFor method where the for-attribute contains characters that need escaping to be valid inside a selector (http://plugins.jquery.com/node/9611) 1.5.5 --- * Fix for http://plugins.jquery.com/node/8659 * Fixed trailing comma in messages_cs.js 1.5.4 --- * Fixed remote method bug (http://plugins.jquery.com/node/8658) 1.5.3 --- * Fixed a bug related to the wrapper-option, where all ancestor-elements that matched the wrapper-option where selected (http://plugins.jquery.com/node/7624) * Updated multipart demo to use latest jQuery UI accordion * Added dateNL and time methods to additionalMethods.js * Added Traditional Chinese (Taiwan, tw) and Kazakhstan (KK) localization * Moved jQuery.format (formerly String.format) to jQuery.validator.format, jQuery.format is deprecated and will be removed in 1.6 (see http://code.google.com/p/jquery-utils/issues/detail?id=15 for details) * Cleaned up messages_pl.js and messages_ptbr.js (still defined messages for max/min/rangeValue, which were removed in 1.4) * Fixed flawed boolean logic in valid-plugin-method for multiple elements; now all elements need to be valid for a boolean-true result (http://plugins.jquery.com/node/8481) * Enhancement $.validator.addMethod: An undefined third message-argument won't overwrite an existing message (http://plugins.jquery.com/node/8443) * Enhancement to submitHandler option: When used, click events on submit buttons are captured and the submitting button is inserted into the form before calling submitHandler, and removed afterwards; keeps submit buttons intact (http://plugins.jquery.com/node/7183#comment-3585) * Added option validClass, default "valid", which adds that class to all valid elements, after validation (http://dev.jquery.com/ticket/2205) * Added creditcardtypes method to additionalMethods.js, including tests (via http://dev.jquery.com/ticket/3635) * Improved remote method to allow serverside message as a string, or true for valid, or false for invalid using the clientside defined message (http://dev.jquery.com/ticket/3807) * Improved accept method to also accept a Drupal-style comma-separated list of values (http://plugins.jquery.com/node/8580) 1.5.2 --- * Fixed messages in additional-methods.js for maxWords, minWords, and rangeWords to include call to $.format * Fixed value passed to methods to exclude carriage return (\r), same as jQuery's val() does * Added slovak (sk) localization * Added demo for integration with jQuery UI tabs * Added selects-grouping example to tabs demo (see second tab, birthdate field) 1.5.1 --- * Updated marketo demo to use invalidHandler option instead of binding invalid-form event * Added TinyMCE integration example * Added ukrainian (ua) localization * Fixed length validation to work with trimmed value (regression from 1.5 where general trimming before validation was removed) * Various small fixes for compatibility with both 1.2.6 and 1.3 1.5 --- * Improved basic demo, validating confirm-password field after password changed * Fixed basic validation to pass the untrimmed input value as the first parameter to validation methods, changed required accordingly; breaks existing custom method that rely on the trimming * Added norwegian (no), italian (it), hungarian (hu) and romanian (ro) localization * Fixed #3195: Two flaws in swedish localization * Fixed #3503: Extended rules("add") to accept messages property: use to specify add custom messages to an element via rules("add", { messages: { required: "Required! " } }); * Fixed #3356: Regression from #2908 when using meta-option * Fixed #3370: Added ignoreTitle option, set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compatibility * Fixed #3516: Trigger invalid-form event even when remote validation is involved * Added invalidHandler option as a shortcut to bind("invalid-form", function() {}) * Fixed Safari issue for loading indicator in ajaxSubmit-integration-demo (append to body first, then hide) * Added test for creditcard validation and improved default message * Enhanced remote validation, accepting options to passthrough to $.ajax as parameter (either url string or options, including url property plus everything else that $.ajax supports) 1.4 --- * Fixed #2931, validate elements in document order and ignore type=image inputs * Fixed usage of $ and jQuery variables, now fully compatible with all variations of noConflict usage * Implemented #2908, enabling custom messages via metadata ala class="{required:true,messages:{required:'required field'}}", added demo/custom-messages-metadata-demo.html * Removed deprecated methods minValue (min), maxValue (max), rangeValue (rangevalue), minLength (minlength), maxLength (maxlength), rangeLength (rangelength) * Fixed #2215 regression: Call unhighlight only for current elements, not everything * Implemented #2989, enabling image button to cancel validation * Fixed issue where IE incorrectly validates against maxlength=0 * Added czech (cs) localization * Reset validator.submitted on validator.resetForm(), enabling a full reset when necessary * Fixed #3035, skipping all falsy attributes when reading rules (0, undefined, empty string), removed part of the maxlength workaround (for 0) * Added dutch (nl) localization (#3201) 1.3 --- * Fixed invalid-form event, now only triggered when form is invalid * Added spanish (es), russian (ru), portuguese brazilian (ptbr), turkish (tr), and polish (pl) localization * Added removeAttrs plugin to facilitate adding and removing multiple attributes * Added groups option to display a single message for multiple elements, via groups: { arbitraryGroupName: "fieldName1 fieldName2[, fieldNameN" } * Enhanced rules() for adding and removing (static) rules: rules("add", "method1[, methodN]"/{method1:param[, method_n:param]}) and rules("remove"[, "method1[, method_n]") * Enhanced rules-option, accepts space-separated string-list of methods, eg. {birthdate: "required date"} * Fixed checkbox group validation with inline rules: As long as the rules are specified on the first element, the group is now properly validated on click * Fixed #2473, ignoring all rules with an explicit parameter of boolean-false, eg. required:false is the same as not specifying required at all (it was handled as required:true so far) * Fixed #2424, with a modified patch from #2473: Methods returning a dependency-mismatch don't stop other rules from being evaluated anymore; still, success isn't applied for optional fields * Fixed url and email validation to not use trimmed values * Fixed creditcard validation to accept only digits and dashes ("asdf" is not a valid creditcard number) * Allow both button and input elements for cancel buttons (via class="cancel") * Fixed #2215: Fixed message display to call unhighlight as part of showing and hiding messages, no more visual side-effects while checking an element and extracted validator.checkForm to validate a form without UI sideeffects * Rewrote custom selectors (:blank, :filled, :unchecked) with functions for compatibility with AIR 1.2.1 ----- * Bundled delegate plugin with validate plugin - its always required anyway * Improved remote validation to include parts from the ajaxQueue plugin for proper synchronization (no additional plugin necessary) * Fixed stopRequest to prevent pendingRequest < 0 * Added jQuery.validator.autoCreateRanges property, defaults to false, enable to convert min/max to range and minlength/maxlength to rangelength; this basically fixes the issue introduced by automatically creating ranges in 1.2 * Fixed optional-methods to not highlight anything at all if the field is blank, that is, don't trigger success * Allow false/null for highlight/unhighlight options instead of forcing a do-nothing-callback even when nothing needs to be highlighted * Fixed validate() call with no elements selected, returning undefined instead of throwing an error * Improved demo, replacing metadata with classes/attributes for specifying rules * Fixed error when no custom message is used for remote validation * Modified email and url validation to require domain label and top label * Fixed url and email validation to require TLD (actually to require domain label); 1.2 version (TLD is optional) is moved to additions as url2 and email2 * Fixed dynamic-totals demo in IE6/7 and improved templating, using textarea to store multiline template and string interpolation * Added login form example with "Email password" link that makes the password field optional * Enhanced dynamic-totals demo with an example of a single message for two fields 1.2 --- * Added AJAX-captcha validation example (based on http://psyrens.com/captcha/) * Added remember-the-milk-demo (thanks RTM team for the permission!) * Added marketo-demo (thanks Glen Lipka!) * Added support for ajax-validation, see method "remote"; serverside returns JSON, true for valid elements, false or a String for invalid, String is used as message * Added highlight and unhighlight options, by default toggles errorClass on element, allows custom highlighting * Added valid() plugin method for easy programmatic checking of forms and fields without the need to use the validator API * Added rules() plugin method to read and write rules for an element (currently read only) * Replaced regex for email method, thanks to the contribution by Scott Gonzalez, see http://projects.scottsplayground.com/email_address_validation/ * Restructured event architecture to rely solely on delegation, both improving performance, and ease-of-use for the developer (requires jquery.delegate.js) * Moved documentation from inline to http://docs.jquery.com/Plugins/Validation - including interactive examples for all methods * Removed validator.refresh(), validation is now completely dynamic * Renamed minValue to min, maxValue to max and rangeValue to range, deprecating the previous names (to be removed in 1.3) * Renamed minLength to minlength, maxLength to maxlength and rangeLength to rangelength, deprecating the previous names (to be removed in 1.3) * Added feature to merge min + max into and range and minlength + maxlength into rangelength * Added support for dynamic rule parameters, allowing to specify a function as a parameter eg. for minlength, called when validating the element * Allow to specify null or an empty string as a message to display nothing (see marketo demo) * Rules overhaul: Now supports combination of rules-option, metadata, classes (new) and attributes (new), see rules() for details 1.1.2 --- * Replaced regex for URL method, thanks to the contribution by Scott Gonzalez, see http://projects.scottsplayground.com/iri/ * Improved email method to better handle unicode characters * Fixed error container to hide when all elements are valid, not only on form submit * Fixed String.format to jQuery.format (moving into jQuery namespace) * Fixed accept method to accept both upper and lowercase extensions * Fixed validate() plugin method to create only one validator instance for a given form and always return that one instance (avoids binding events multiple times) * Changed debug-mode console log from "error" to "warn" level 1.1.1 ----- * Fixed invalid XHTML, preventing error label creation in IE since jQuery 1.1.4 * Fixed and improved String.format: Global search & replace, better handling of array arguments * Fixed cancel-button handling to use validator-object for storing state instead of form element * Fixed name selectors to handle "complex" names, eg. containing brackets ("list[]") * Added button and disabled elements to exclude from validation * Moved element event handlers to refresh to be able to add handlers to new elements * Fixed email validation to allow long top level domains (eg. ".travel") * Moved showErrors() from valid() to form() * Added validator.size(): returns the number of current errors * Call submitHandler with validator as scope for easier access of it's methods, eg. to find error labels using errorsFor(Element) * Compatible with jQuery 1.1.x and 1.2.x 1.1 --- * Added validation on blur, keyup and click (for checkboxes and radiobutton). Replaces event-option. * Fixed resetForm * Fixed custom-methods-demo 1.0 --- * Improved number and numberDE methods to check for correct decimal numbers with delimiters * Only elements that have rules are checked (otherwise success-option is applied to all elements) * Added creditcard number method (thanks to Brian Klug) * Added ignore-option, eg. ignore: "[@type=hidden]", using that expression to exclude elements to validate. Default: none, though submit and reset buttons are always ignored * Heavily enhanced Functions-as-messages by providing a flexible String.format helper * Accept Functions as messages, providing runtime-custom-messages * Fixed exclusion of elements without rules from successList * Fixed custom-method-demo, replaced the alert with message displaying the number of errors * Fixed form-submit-prevention when using submitHandler * Completely removed dependency on element IDs, though they are still used (when present) to link error labels to inputs. Achieved by using an array with {name, message, element} instead of an object with id:message pairs for the internal errorList. * Added support for specifying simple rules as simple strings, eg. "required" is equivalent to {required: true} * Added feature: Add errorClass to invalid field�s parent element, making it easy to style the label/field container or the label for the field. * Added feature: focusCleanup - If enabled, removes the errorClass from the invalid elements and hides all errors messages whenever the element is focused. * Added success option to show the a field was validated successfully * Fixed Opera select-issue (avoiding a attribute-collision) * Fixed problems with focussing hidden elements in IE * Added feature to skip validation for submit buttons with class "cancel" * Fixed potential issues with Google Toolbar by preferring plugin option messages over title attribute * submitHandler is only called when an actual submit event was handled, validator.form() returns false only for invalid forms * Invalid elements are now focused only on submit or via validator.focusInvalid(), avoiding all trouble with focus-on-blur * IE6 error container layout issue is solved * Customize error element via errorElement option * Added validator.refresh() to find new inputs in the form * Added accept validation method, checks file extensions * Improved dependency feature by adding two custom expressions: ":blank" to select elements with an empty value and �:filled� to select elements with a value, both excluding whitespace * Added a resetForm() method to the validator: Resets each form element (using the form plugin, if available), removes classes on invalid elements and hides all error messages * Fixed docs for validator.showErrors() * Fixed error label creation to always use html() instead of text(), allowing arbitrary HTML passed in as messages * Fixed error label creation to use specified error class * Added dependency feature: The requires method accepts both String (jQuery expressions) and Functions as the argument * Heavily improved customizing of error message display: Use normal messages and show/hide an additional container; Completely replace message display with own mechanism (while being able to delegate to the default handler; Customize placing of generated labels (instead of default below-element) * Fixed two major bugs in IE (error containers) and Opera (metadata) * Modified validation methods to accept empty fields as valid (exception: of course �required� and also �equalTo� methods) * Renamed "min" to "minLength", "max" to "maxLength", "length" to "rangeLength" * Added "minValue", "maxValue" and "rangeValue" * Streamlined API for support of different events. The default, submit, can be disabled. If any event is specified, that is applied to each element (instead of the entire form). Combining keyup-validation with submit-validation is now extremely easy to setup * Added support for one-message-per-rule when defining messages via plugin settings * Added support to wrap metadata in some parent element. Useful when metadata is used for other plugins, too. * Refactored tests and demos: Less files, better demos * Improved documentation: More examples for methods, more reference texts explaining some basics ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/dist/additional-methods.js ================================================ /*! * jQuery Validation Plugin v1.14.0 * * http://jqueryvalidation.org/ * * Copyright (c) 2015 Jörn Zaefferer * Released under the MIT license */ (function( factory ) { if ( typeof define === "function" && define.amd ) { define( ["jquery", "./jquery.validate"], factory ); } else { factory( jQuery ); } }(function( $ ) { (function() { function stripHtml(value) { // remove html tags and space chars return value.replace(/<.[^<>]*?>/g, " ").replace(/ | /gi, " ") // remove punctuation .replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g, ""); } $.validator.addMethod("maxWords", function(value, element, params) { return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length <= params; }, $.validator.format("Please enter {0} words or less.")); $.validator.addMethod("minWords", function(value, element, params) { return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params; }, $.validator.format("Please enter at least {0} words.")); $.validator.addMethod("rangeWords", function(value, element, params) { var valueStripped = stripHtml(value), regex = /\b\w+\b/g; return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1]; }, $.validator.format("Please enter between {0} and {1} words.")); }()); // Accept a value from a file input based on a required mimetype $.validator.addMethod("accept", function(value, element, param) { // Split mime on commas in case we have multiple types we can accept var typeParam = typeof param === "string" ? param.replace(/\s/g, "").replace(/,/g, "|") : "image/*", optionalValue = this.optional(element), i, file; // Element is optional if (optionalValue) { return optionalValue; } if ($(element).attr("type") === "file") { // If we are using a wildcard, make it regex friendly typeParam = typeParam.replace(/\*/g, ".*"); // Check if the element has a FileList before checking each file if (element.files && element.files.length) { for (i = 0; i < element.files.length; i++) { file = element.files[i]; // Grab the mimetype from the loaded file, verify it matches if (!file.type.match(new RegExp( "\\.?(" + typeParam + ")$", "i"))) { return false; } } } } // Either return true because we've validated each file, or because the // browser does not support element.files and the FileList feature return true; }, $.validator.format("Please enter a value with a valid mimetype.")); $.validator.addMethod("alphanumeric", function(value, element) { return this.optional(element) || /^\w+$/i.test(value); }, "Letters, numbers, and underscores only please"); /* * Dutch bank account numbers (not 'giro' numbers) have 9 digits * and pass the '11 check'. * We accept the notation with spaces, as that is common. * acceptable: 123456789 or 12 34 56 789 */ $.validator.addMethod("bankaccountNL", function(value, element) { if (this.optional(element)) { return true; } if (!(/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value))) { return false; } // now '11 check' var account = value.replace(/ /g, ""), // remove spaces sum = 0, len = account.length, pos, factor, digit; for ( pos = 0; pos < len; pos++ ) { factor = len - pos; digit = account.substring(pos, pos + 1); sum = sum + factor * digit; } return sum % 11 === 0; }, "Please specify a valid bank account number"); $.validator.addMethod("bankorgiroaccountNL", function(value, element) { return this.optional(element) || ($.validator.methods.bankaccountNL.call(this, value, element)) || ($.validator.methods.giroaccountNL.call(this, value, element)); }, "Please specify a valid bank or giro account number"); /** * BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity. * * BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional) * * BIC definition in detail: * - First 4 characters - bank code (only letters) * - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters) * - Next 2 characters - location code (letters and digits) * a. shall not start with '0' or '1' * b. second character must be a letter ('O' is not allowed) or one of the following digits ('0' for test (therefore not allowed), '1' for passive participant and '2' for active participant) * - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits) */ $.validator.addMethod("bic", function(value, element) { return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value ); }, "Please specify a valid BIC code"); /* * Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities * Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal */ $.validator.addMethod( "cifES", function( value ) { "use strict"; var num = [], controlDigit, sum, i, count, tmp, secondDigit; value = value.toUpperCase(); // Quick format test if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { return false; } for ( i = 0; i < 9; i++ ) { num[ i ] = parseInt( value.charAt( i ), 10 ); } // Algorithm for checking CIF codes sum = num[ 2 ] + num[ 4 ] + num[ 6 ]; for ( count = 1; count < 8; count += 2 ) { tmp = ( 2 * num[ count ] ).toString(); secondDigit = tmp.charAt( 1 ); sum += parseInt( tmp.charAt( 0 ), 10 ) + ( secondDigit === "" ? 0 : parseInt( secondDigit, 10 ) ); } /* The first (position 1) is a letter following the following criteria: * A. Corporations * B. LLCs * C. General partnerships * D. Companies limited partnerships * E. Communities of goods * F. Cooperative Societies * G. Associations * H. Communities of homeowners in horizontal property regime * J. Civil Societies * K. Old format * L. Old format * M. Old format * N. Nonresident entities * P. Local authorities * Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions * R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008) * S. Organs of State Administration and regions * V. Agrarian Transformation * W. Permanent establishments of non-resident in Spain */ if ( /^[ABCDEFGHJNPQRSUVW]{1}/.test( value ) ) { sum += ""; controlDigit = 10 - parseInt( sum.charAt( sum.length - 1 ), 10 ); value += controlDigit; return ( num[ 8 ].toString() === String.fromCharCode( 64 + controlDigit ) || num[ 8 ].toString() === value.charAt( value.length - 1 ) ); } return false; }, "Please specify a valid CIF number." ); /* * Brazillian CPF number (Cadastrado de Pessoas Físicas) is the equivalent of a Brazilian tax registration number. * CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. */ $.validator.addMethod("cpfBR", function(value) { // Removing special characters from value value = value.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, ""); // Checking value to have 11 digits only if (value.length !== 11) { return false; } var sum = 0, firstCN, secondCN, checkResult, i; firstCN = parseInt(value.substring(9, 10), 10); secondCN = parseInt(value.substring(10, 11), 10); checkResult = function(sum, cn) { var result = (sum * 10) % 11; if ((result === 10) || (result === 11)) {result = 0;} return (result === cn); }; // Checking for dump data if (value === "" || value === "00000000000" || value === "11111111111" || value === "22222222222" || value === "33333333333" || value === "44444444444" || value === "55555555555" || value === "66666666666" || value === "77777777777" || value === "88888888888" || value === "99999999999" ) { return false; } // Step 1 - using first Check Number: for ( i = 1; i <= 9; i++ ) { sum = sum + parseInt(value.substring(i - 1, i), 10) * (11 - i); } // If first Check Number (CN) is valid, move to Step 2 - using second Check Number: if ( checkResult(sum, firstCN) ) { sum = 0; for ( i = 1; i <= 10; i++ ) { sum = sum + parseInt(value.substring(i - 1, i), 10) * (12 - i); } return checkResult(sum, secondCN); } return false; }, "Please specify a valid CPF number"); /* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator * Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 * Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings) */ $.validator.addMethod("creditcardtypes", function(value, element, param) { if (/[^0-9\-]+/.test(value)) { return false; } value = value.replace(/\D/g, ""); var validTypes = 0x0000; if (param.mastercard) { validTypes |= 0x0001; } if (param.visa) { validTypes |= 0x0002; } if (param.amex) { validTypes |= 0x0004; } if (param.dinersclub) { validTypes |= 0x0008; } if (param.enroute) { validTypes |= 0x0010; } if (param.discover) { validTypes |= 0x0020; } if (param.jcb) { validTypes |= 0x0040; } if (param.unknown) { validTypes |= 0x0080; } if (param.all) { validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080; } if (validTypes & 0x0001 && /^(5[12345])/.test(value)) { //mastercard return value.length === 16; } if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa return value.length === 16; } if (validTypes & 0x0004 && /^(3[47])/.test(value)) { //amex return value.length === 15; } if (validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test(value)) { //dinersclub return value.length === 14; } if (validTypes & 0x0010 && /^(2(014|149))/.test(value)) { //enroute return value.length === 15; } if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover return value.length === 16; } if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb return value.length === 16; } if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb return value.length === 15; } if (validTypes & 0x0080) { //unknown return true; } return false; }, "Please enter a valid credit card number."); /** * Validates currencies with any given symbols by @jameslouiz * Symbols can be optional or required. Symbols required by default * * Usage examples: * currency: ["£", false] - Use false for soft currency validation * currency: ["$", false] * currency: ["RM", false] - also works with text based symbols such as "RM" - Malaysia Ringgit etc * * * * Soft symbol checking * currencyInput: { * currency: ["$", false] * } * * Strict symbol checking (default) * currencyInput: { * currency: "$" * //OR * currency: ["$", true] * } * * Multiple Symbols * currencyInput: { * currency: "$,£,¢" * } */ $.validator.addMethod("currency", function(value, element, param) { var isParamString = typeof param === "string", symbol = isParamString ? param : param[0], soft = isParamString ? true : param[1], regex; symbol = symbol.replace(/,/g, ""); symbol = soft ? symbol + "]" : symbol + "]?"; regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$"; regex = new RegExp(regex); return this.optional(element) || regex.test(value); }, "Please specify a valid currency"); $.validator.addMethod("dateFA", function(value, element) { return this.optional(element) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(value); }, $.validator.messages.date); /** * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy. * * @example $.validator.methods.date("01/01/1900") * @result true * * @example $.validator.methods.date("01/13/1990") * @result false * * @example $.validator.methods.date("01.01.1900") * @result false * * @example * @desc Declares an optional input element whose value must be a valid date. * * @name $.validator.methods.dateITA * @type Boolean * @cat Plugins/Validate/Methods */ $.validator.addMethod("dateITA", function(value, element) { var check = false, re = /^\d{1,2}\/\d{1,2}\/\d{4}$/, adata, gg, mm, aaaa, xdata; if ( re.test(value)) { adata = value.split("/"); gg = parseInt(adata[0], 10); mm = parseInt(adata[1], 10); aaaa = parseInt(adata[2], 10); xdata = new Date(Date.UTC(aaaa, mm - 1, gg, 12, 0, 0, 0)); if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth () === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) { check = true; } else { check = false; } } else { check = false; } return this.optional(element) || check; }, $.validator.messages.date); $.validator.addMethod("dateNL", function(value, element) { return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value); }, $.validator.messages.date); // Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept $.validator.addMethod("extension", function(value, element, param) { param = typeof param === "string" ? param.replace(/,/g, "|") : "png|jpe?g|gif"; return this.optional(element) || value.match(new RegExp("\\.(" + param + ")$", "i")); }, $.validator.format("Please enter a value with a valid extension.")); /** * Dutch giro account numbers (not bank numbers) have max 7 digits */ $.validator.addMethod("giroaccountNL", function(value, element) { return this.optional(element) || /^[0-9]{1,7}$/.test(value); }, "Please specify a valid giro account number"); /** * IBAN is the international bank account number. * It has a country - specific format, that is checked here too */ $.validator.addMethod("iban", function(value, element) { // some quick simple tests to prevent needless work if (this.optional(element)) { return true; } // remove spaces and to upper case var iban = value.replace(/ /g, "").toUpperCase(), ibancheckdigits = "", leadingZeroes = true, cRest = "", cOperator = "", countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p; // check the country code and find the country specific format countrycode = iban.substring(0, 2); bbancountrypatterns = { "AL": "\\d{8}[\\dA-Z]{16}", "AD": "\\d{8}[\\dA-Z]{12}", "AT": "\\d{16}", "AZ": "[\\dA-Z]{4}\\d{20}", "BE": "\\d{12}", "BH": "[A-Z]{4}[\\dA-Z]{14}", "BA": "\\d{16}", "BR": "\\d{23}[A-Z][\\dA-Z]", "BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}", "CR": "\\d{17}", "HR": "\\d{17}", "CY": "\\d{8}[\\dA-Z]{16}", "CZ": "\\d{20}", "DK": "\\d{14}", "DO": "[A-Z]{4}\\d{20}", "EE": "\\d{16}", "FO": "\\d{14}", "FI": "\\d{14}", "FR": "\\d{10}[\\dA-Z]{11}\\d{2}", "GE": "[\\dA-Z]{2}\\d{16}", "DE": "\\d{18}", "GI": "[A-Z]{4}[\\dA-Z]{15}", "GR": "\\d{7}[\\dA-Z]{16}", "GL": "\\d{14}", "GT": "[\\dA-Z]{4}[\\dA-Z]{20}", "HU": "\\d{24}", "IS": "\\d{22}", "IE": "[\\dA-Z]{4}\\d{14}", "IL": "\\d{19}", "IT": "[A-Z]\\d{10}[\\dA-Z]{12}", "KZ": "\\d{3}[\\dA-Z]{13}", "KW": "[A-Z]{4}[\\dA-Z]{22}", "LV": "[A-Z]{4}[\\dA-Z]{13}", "LB": "\\d{4}[\\dA-Z]{20}", "LI": "\\d{5}[\\dA-Z]{12}", "LT": "\\d{16}", "LU": "\\d{3}[\\dA-Z]{13}", "MK": "\\d{3}[\\dA-Z]{10}\\d{2}", "MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}", "MR": "\\d{23}", "MU": "[A-Z]{4}\\d{19}[A-Z]{3}", "MC": "\\d{10}[\\dA-Z]{11}\\d{2}", "MD": "[\\dA-Z]{2}\\d{18}", "ME": "\\d{18}", "NL": "[A-Z]{4}\\d{10}", "NO": "\\d{11}", "PK": "[\\dA-Z]{4}\\d{16}", "PS": "[\\dA-Z]{4}\\d{21}", "PL": "\\d{24}", "PT": "\\d{21}", "RO": "[A-Z]{4}[\\dA-Z]{16}", "SM": "[A-Z]\\d{10}[\\dA-Z]{12}", "SA": "\\d{2}[\\dA-Z]{18}", "RS": "\\d{18}", "SK": "\\d{20}", "SI": "\\d{15}", "ES": "\\d{20}", "SE": "\\d{20}", "CH": "\\d{5}[\\dA-Z]{12}", "TN": "\\d{20}", "TR": "\\d{5}[\\dA-Z]{17}", "AE": "\\d{3}\\d{16}", "GB": "[A-Z]{4}\\d{14}", "VG": "[\\dA-Z]{4}\\d{16}" }; bbanpattern = bbancountrypatterns[countrycode]; // As new countries will start using IBAN in the // future, we only check if the countrycode is known. // This prevents false negatives, while almost all // false positives introduced by this, will be caught // by the checksum validation below anyway. // Strict checking should return FALSE for unknown // countries. if (typeof bbanpattern !== "undefined") { ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", ""); if (!(ibanregexp.test(iban))) { return false; // invalid country specific format } } // now check the checksum, first convert to digits ibancheck = iban.substring(4, iban.length) + iban.substring(0, 4); for (i = 0; i < ibancheck.length; i++) { charAt = ibancheck.charAt(i); if (charAt !== "0") { leadingZeroes = false; } if (!leadingZeroes) { ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt); } } // calculate the result of: ibancheckdigits % 97 for (p = 0; p < ibancheckdigits.length; p++) { cChar = ibancheckdigits.charAt(p); cOperator = "" + cRest + "" + cChar; cRest = cOperator % 97; } return cRest === 1; }, "Please specify a valid IBAN"); $.validator.addMethod("integer", function(value, element) { return this.optional(element) || /^-?\d+$/.test(value); }, "A positive or negative non-decimal number please"); $.validator.addMethod("ipv4", function(value, element) { return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value); }, "Please enter a valid IP v4 address."); $.validator.addMethod("ipv6", function(value, element) { return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value); }, "Please enter a valid IP v6 address."); $.validator.addMethod("lettersonly", function(value, element) { return this.optional(element) || /^[a-z]+$/i.test(value); }, "Letters only please"); $.validator.addMethod("letterswithbasicpunc", function(value, element) { return this.optional(element) || /^[a-z\-.,()'"\s]+$/i.test(value); }, "Letters or punctuation only please"); $.validator.addMethod("mobileNL", function(value, element) { return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(value); }, "Please specify a valid mobile number"); /* For UK phone functions, do the following server side processing: * Compare original input with this RegEx pattern: * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0' * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. * A number of very detailed GB telephone number RegEx patterns can also be found at: * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers */ $.validator.addMethod("mobileUK", function(phone_number, element) { phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/); }, "Please specify a valid mobile number"); /* * The número de identidad de extranjero ( NIE )is a code used to identify the non-nationals in Spain */ $.validator.addMethod( "nieES", function( value ) { "use strict"; value = value.toUpperCase(); // Basic format test if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { return false; } // Test NIE //T if ( /^[T]{1}/.test( value ) ) { return ( value[ 8 ] === /^[T]{1}[A-Z0-9]{8}$/.test( value ) ); } //XYZ if ( /^[XYZ]{1}/.test( value ) ) { return ( value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.replace( "X", "0" ) .replace( "Y", "1" ) .replace( "Z", "2" ) .substring( 0, 8 ) % 23 ) ); } return false; }, "Please specify a valid NIE number." ); /* * The Número de Identificación Fiscal ( NIF ) is the way tax identification used in Spain for individuals */ $.validator.addMethod( "nifES", function( value ) { "use strict"; value = value.toUpperCase(); // Basic format test if ( !value.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)") ) { return false; } // Test NIF if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) { return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) ); } // Test specials NIF (starts with K, L or M) if ( /^[KLM]{1}/.test( value ) ) { return ( value[ 8 ] === String.fromCharCode( 64 ) ); } return false; }, "Please specify a valid NIF number." ); jQuery.validator.addMethod( "notEqualTo", function( value, element, param ) { return this.optional(element) || !$.validator.methods.equalTo.call( this, value, element, param ); }, "Please enter a different value, values must not be the same." ); $.validator.addMethod("nowhitespace", function(value, element) { return this.optional(element) || /^\S+$/i.test(value); }, "No white space please"); /** * Return true if the field value matches the given format RegExp * * @example $.validator.methods.pattern("AR1004",element,/^AR\d{4}$/) * @result true * * @example $.validator.methods.pattern("BR1004",element,/^AR\d{4}$/) * @result false * * @name $.validator.methods.pattern * @type Boolean * @cat Plugins/Validate/Methods */ $.validator.addMethod("pattern", function(value, element, param) { if (this.optional(element)) { return true; } if (typeof param === "string") { param = new RegExp("^(?:" + param + ")$"); } return param.test(value); }, "Invalid format."); /** * Dutch phone numbers have 10 digits (or 11 and start with +31). */ $.validator.addMethod("phoneNL", function(value, element) { return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(value); }, "Please specify a valid phone number."); /* For UK phone functions, do the following server side processing: * Compare original input with this RegEx pattern: * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0' * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. * A number of very detailed GB telephone number RegEx patterns can also be found at: * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers */ $.validator.addMethod("phoneUK", function(phone_number, element) { phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/); }, "Please specify a valid phone number"); /** * matches US phone number format * * where the area code may not start with 1 and the prefix may not start with 1 * allows '-' or ' ' as a separator and allows parens around area code * some people may want to put a '1' in front of their number * * 1(212)-999-2345 or * 212 999 2344 or * 212-999-0983 * * but not * 111-123-5434 * and not * 212 123 4567 */ $.validator.addMethod("phoneUS", function(phone_number, element) { phone_number = phone_number.replace(/\s+/g, ""); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/); }, "Please specify a valid phone number"); /* For UK phone functions, do the following server side processing: * Compare original input with this RegEx pattern: * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0' * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. * A number of very detailed GB telephone number RegEx patterns can also be found at: * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers */ //Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers $.validator.addMethod("phonesUK", function(phone_number, element) { phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/); }, "Please specify a valid uk phone number"); /** * Matches a valid Canadian Postal Code * * @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element ) * @result true * * @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element ) * @result false * * @name jQuery.validator.methods.postalCodeCA * @type Boolean * @cat Plugins/Validate/Methods */ $.validator.addMethod( "postalCodeCA", function( value, element ) { return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test( value ); }, "Please specify a valid postal code" ); /* * Valida CEPs do brasileiros: * * Formatos aceitos: * 99999-999 * 99.999-999 * 99999999 */ $.validator.addMethod("postalcodeBR", function(cep_value, element) { return this.optional(element) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value ); }, "Informe um CEP válido."); /* Matches Italian postcode (CAP) */ $.validator.addMethod("postalcodeIT", function(value, element) { return this.optional(element) || /^\d{5}$/.test(value); }, "Please specify a valid postal code"); $.validator.addMethod("postalcodeNL", function(value, element) { return this.optional(element) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(value); }, "Please specify a valid postal code"); // Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK) $.validator.addMethod("postcodeUK", function(value, element) { return this.optional(element) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(value); }, "Please specify a valid UK postcode"); /* * Lets you say "at least X inputs that match selector Y must be filled." * * The end result is that neither of these inputs: * * * * * ...will validate unless at least one of them is filled. * * partnumber: {require_from_group: [1,".productinfo"]}, * description: {require_from_group: [1,".productinfo"]} * * options[0]: number of fields that must be filled in the group * options[1]: CSS selector that defines the group of conditionally required fields */ $.validator.addMethod("require_from_group", function(value, element, options) { var $fields = $(options[1], element.form), $fieldsFirst = $fields.eq(0), validator = $fieldsFirst.data("valid_req_grp") ? $fieldsFirst.data("valid_req_grp") : $.extend({}, this), isValid = $fields.filter(function() { return validator.elementValue(this); }).length >= options[0]; // Store the cloned validator for future validation $fieldsFirst.data("valid_req_grp", validator); // If element isn't being validated, run each require_from_group field's validation rules if (!$(element).data("being_validated")) { $fields.data("being_validated", true); $fields.each(function() { validator.element(this); }); $fields.data("being_validated", false); } return isValid; }, $.validator.format("Please fill at least {0} of these fields.")); /* * Lets you say "either at least X inputs that match selector Y must be filled, * OR they must all be skipped (left blank)." * * The end result, is that none of these inputs: * * * * * * ...will validate unless either at least two of them are filled, * OR none of them are. * * partnumber: {skip_or_fill_minimum: [2,".productinfo"]}, * description: {skip_or_fill_minimum: [2,".productinfo"]}, * color: {skip_or_fill_minimum: [2,".productinfo"]} * * options[0]: number of fields that must be filled in the group * options[1]: CSS selector that defines the group of conditionally required fields * */ $.validator.addMethod("skip_or_fill_minimum", function(value, element, options) { var $fields = $(options[1], element.form), $fieldsFirst = $fields.eq(0), validator = $fieldsFirst.data("valid_skip") ? $fieldsFirst.data("valid_skip") : $.extend({}, this), numberFilled = $fields.filter(function() { return validator.elementValue(this); }).length, isValid = numberFilled === 0 || numberFilled >= options[0]; // Store the cloned validator for future validation $fieldsFirst.data("valid_skip", validator); // If element isn't being validated, run each skip_or_fill_minimum field's validation rules if (!$(element).data("being_validated")) { $fields.data("being_validated", true); $fields.each(function() { validator.element(this); }); $fields.data("being_validated", false); } return isValid; }, $.validator.format("Please either skip these fields or fill at least {0} of them.")); /* Validates US States and/or Territories by @jdforsythe * Can be case insensitive or require capitalization - default is case insensitive * Can include US Territories or not - default does not * Can include US Military postal abbreviations (AA, AE, AP) - default does not * * Note: "States" always includes DC (District of Colombia) * * Usage examples: * * This is the default - case insensitive, no territories, no military zones * stateInput: { * caseSensitive: false, * includeTerritories: false, * includeMilitary: false * } * * Only allow capital letters, no territories, no military zones * stateInput: { * caseSensitive: false * } * * Case insensitive, include territories but not military zones * stateInput: { * includeTerritories: true * } * * Only allow capital letters, include territories and military zones * stateInput: { * caseSensitive: true, * includeTerritories: true, * includeMilitary: true * } * * * */ $.validator.addMethod("stateUS", function(value, element, options) { var isDefault = typeof options === "undefined", caseSensitive = ( isDefault || typeof options.caseSensitive === "undefined" ) ? false : options.caseSensitive, includeTerritories = ( isDefault || typeof options.includeTerritories === "undefined" ) ? false : options.includeTerritories, includeMilitary = ( isDefault || typeof options.includeMilitary === "undefined" ) ? false : options.includeMilitary, regex; if (!includeTerritories && !includeMilitary) { regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; } else if (includeTerritories && includeMilitary) { regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; } else if (includeTerritories) { regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; } else { regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; } regex = caseSensitive ? new RegExp(regex) : new RegExp(regex, "i"); return this.optional(element) || regex.test(value); }, "Please specify a valid state"); // TODO check if value starts with <, otherwise don't try stripping anything $.validator.addMethod("strippedminlength", function(value, element, param) { return $(value).text().length >= param; }, $.validator.format("Please enter at least {0} characters")); $.validator.addMethod("time", function(value, element) { return this.optional(element) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(value); }, "Please enter a valid time, between 00:00 and 23:59"); $.validator.addMethod("time12h", function(value, element) { return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(value); }, "Please enter a valid time in 12-hour am/pm format"); // same as url, but TLD is optional $.validator.addMethod("url2", function(value, element) { return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); }, $.validator.messages.url); /** * Return true, if the value is a valid vehicle identification number (VIN). * * Works with all kind of text inputs. * * @example * @desc Declares a required input element whose value must be a valid vehicle identification number. * * @name $.validator.methods.vinUS * @type Boolean * @cat Plugins/Validate/Methods */ $.validator.addMethod("vinUS", function(v) { if (v.length !== 17) { return false; } var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ], VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ], FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ], rs = 0, i, n, d, f, cd, cdv; for (i = 0; i < 17; i++) { f = FL[i]; d = v.slice(i, i + 1); if (i === 8) { cdv = d; } if (!isNaN(d)) { d *= f; } else { for (n = 0; n < LL.length; n++) { if (d.toUpperCase() === LL[n]) { d = VL[n]; d *= f; if (isNaN(cdv) && n === 8) { cdv = LL[n]; } break; } } } rs += d; } cd = rs % 11; if (cd === 10) { cd = "X"; } if (cd === cdv) { return true; } return false; }, "The specified vehicle identification number (VIN) is invalid."); $.validator.addMethod("zipcodeUS", function(value, element) { return this.optional(element) || /^\d{5}(-\d{4})?$/.test(value); }, "The specified US ZIP Code is invalid"); $.validator.addMethod("ziprange", function(value, element) { return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value); }, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx"); })); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/dist/jquery.validate.js ================================================ /*! * jQuery Validation Plugin v1.14.0 * * http://jqueryvalidation.org/ * * Copyright (c) 2015 Jörn Zaefferer * Released under the MIT license */ (function( factory ) { if ( typeof define === "function" && define.amd ) { define( ["jquery"], factory ); } else { factory( jQuery ); } }(function( $ ) { $.extend($.fn, { // http://jqueryvalidation.org/validate/ validate: function( options ) { // if nothing is selected, return nothing; can't chain anyway if ( !this.length ) { if ( options && options.debug && window.console ) { console.warn( "Nothing selected, can't validate, returning nothing." ); } return; } // check if a validator for this form was already created var validator = $.data( this[ 0 ], "validator" ); if ( validator ) { return validator; } // Add novalidate tag if HTML5. this.attr( "novalidate", "novalidate" ); validator = new $.validator( options, this[ 0 ] ); $.data( this[ 0 ], "validator", validator ); if ( validator.settings.onsubmit ) { this.on( "click.validate", ":submit", function( event ) { if ( validator.settings.submitHandler ) { validator.submitButton = event.target; } // allow suppressing validation by adding a cancel class to the submit button if ( $( this ).hasClass( "cancel" ) ) { validator.cancelSubmit = true; } // allow suppressing validation by adding the html5 formnovalidate attribute to the submit button if ( $( this ).attr( "formnovalidate" ) !== undefined ) { validator.cancelSubmit = true; } }); // validate the form on submit this.on( "submit.validate", function( event ) { if ( validator.settings.debug ) { // prevent form submit to be able to see console output event.preventDefault(); } function handle() { var hidden, result; if ( validator.settings.submitHandler ) { if ( validator.submitButton ) { // insert a hidden input as a replacement for the missing submit button hidden = $( "" ) .attr( "name", validator.submitButton.name ) .val( $( validator.submitButton ).val() ) .appendTo( validator.currentForm ); } result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); if ( validator.submitButton ) { // and clean up afterwards; thanks to no-block-scope, hidden can be referenced hidden.remove(); } if ( result !== undefined ) { return result; } return false; } return true; } // prevent submit for invalid forms or custom submit handlers if ( validator.cancelSubmit ) { validator.cancelSubmit = false; return handle(); } if ( validator.form() ) { if ( validator.pendingRequest ) { validator.formSubmitted = true; return false; } return handle(); } else { validator.focusInvalid(); return false; } }); } return validator; }, // http://jqueryvalidation.org/valid/ valid: function() { var valid, validator, errorList; if ( $( this[ 0 ] ).is( "form" ) ) { valid = this.validate().form(); } else { errorList = []; valid = true; validator = $( this[ 0 ].form ).validate(); this.each( function() { valid = validator.element( this ) && valid; errorList = errorList.concat( validator.errorList ); }); validator.errorList = errorList; } return valid; }, // http://jqueryvalidation.org/rules/ rules: function( command, argument ) { var element = this[ 0 ], settings, staticRules, existingRules, data, param, filtered; if ( command ) { settings = $.data( element.form, "validator" ).settings; staticRules = settings.rules; existingRules = $.validator.staticRules( element ); switch ( command ) { case "add": $.extend( existingRules, $.validator.normalizeRule( argument ) ); // remove messages from rules, but allow them to be set separately delete existingRules.messages; staticRules[ element.name ] = existingRules; if ( argument.messages ) { settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); } break; case "remove": if ( !argument ) { delete staticRules[ element.name ]; return existingRules; } filtered = {}; $.each( argument.split( /\s/ ), function( index, method ) { filtered[ method ] = existingRules[ method ]; delete existingRules[ method ]; if ( method === "required" ) { $( element ).removeAttr( "aria-required" ); } }); return filtered; } } data = $.validator.normalizeRules( $.extend( {}, $.validator.classRules( element ), $.validator.attributeRules( element ), $.validator.dataRules( element ), $.validator.staticRules( element ) ), element ); // make sure required is at front if ( data.required ) { param = data.required; delete data.required; data = $.extend( { required: param }, data ); $( element ).attr( "aria-required", "true" ); } // make sure remote is at back if ( data.remote ) { param = data.remote; delete data.remote; data = $.extend( data, { remote: param }); } return data; } }); // Custom selectors $.extend( $.expr[ ":" ], { // http://jqueryvalidation.org/blank-selector/ blank: function( a ) { return !$.trim( "" + $( a ).val() ); }, // http://jqueryvalidation.org/filled-selector/ filled: function( a ) { return !!$.trim( "" + $( a ).val() ); }, // http://jqueryvalidation.org/unchecked-selector/ unchecked: function( a ) { return !$( a ).prop( "checked" ); } }); // constructor for validator $.validator = function( options, form ) { this.settings = $.extend( true, {}, $.validator.defaults, options ); this.currentForm = form; this.init(); }; // http://jqueryvalidation.org/jQuery.validator.format/ $.validator.format = function( source, params ) { if ( arguments.length === 1 ) { return function() { var args = $.makeArray( arguments ); args.unshift( source ); return $.validator.format.apply( this, args ); }; } if ( arguments.length > 2 && params.constructor !== Array ) { params = $.makeArray( arguments ).slice( 1 ); } if ( params.constructor !== Array ) { params = [ params ]; } $.each( params, function( i, n ) { source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { return n; }); }); return source; }; $.extend( $.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusCleanup: false, focusInvalid: true, errorContainer: $( [] ), errorLabelContainer: $( [] ), onsubmit: true, ignore: ":hidden", ignoreTitle: false, onfocusin: function( element ) { this.lastActive = element; // Hide error label and remove error class on focus if enabled if ( this.settings.focusCleanup ) { if ( this.settings.unhighlight ) { this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); } this.hideThese( this.errorsFor( element ) ); } }, onfocusout: function( element ) { if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) { this.element( element ); } }, onkeyup: function( element, event ) { // Avoid revalidate the field when pressing one of the following keys // Shift => 16 // Ctrl => 17 // Alt => 18 // Caps lock => 20 // End => 35 // Home => 36 // Left arrow => 37 // Up arrow => 38 // Right arrow => 39 // Down arrow => 40 // Insert => 45 // Num lock => 144 // AltGr key => 225 var excludedKeys = [ 16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225 ]; if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { return; } else if ( element.name in this.submitted || element === this.lastElement ) { this.element( element ); } }, onclick: function( element ) { // click on selects, radiobuttons and checkboxes if ( element.name in this.submitted ) { this.element( element ); // or option elements, check parent select in that case } else if ( element.parentNode.name in this.submitted ) { this.element( element.parentNode ); } }, highlight: function( element, errorClass, validClass ) { if ( element.type === "radio" ) { this.findByName( element.name ).addClass( errorClass ).removeClass( validClass ); } else { $( element ).addClass( errorClass ).removeClass( validClass ); } }, unhighlight: function( element, errorClass, validClass ) { if ( element.type === "radio" ) { this.findByName( element.name ).removeClass( errorClass ).addClass( validClass ); } else { $( element ).removeClass( errorClass ).addClass( validClass ); } } }, // http://jqueryvalidation.org/jQuery.validator.setDefaults/ setDefaults: function( settings ) { $.extend( $.validator.defaults, settings ); }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date ( ISO ).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", maxlength: $.validator.format( "Please enter no more than {0} characters." ), minlength: $.validator.format( "Please enter at least {0} characters." ), rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ), range: $.validator.format( "Please enter a value between {0} and {1}." ), max: $.validator.format( "Please enter a value less than or equal to {0}." ), min: $.validator.format( "Please enter a value greater than or equal to {0}." ) }, autoCreateRanges: false, prototype: { init: function() { this.labelContainer = $( this.settings.errorLabelContainer ); this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm ); this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer ); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var groups = ( this.groups = {} ), rules; $.each( this.settings.groups, function( key, value ) { if ( typeof value === "string" ) { value = value.split( /\s/ ); } $.each( value, function( index, name ) { groups[ name ] = key; }); }); rules = this.settings.rules; $.each( rules, function( key, value ) { rules[ key ] = $.validator.normalizeRule( value ); }); function delegate( event ) { var validator = $.data( this.form, "validator" ), eventType = "on" + event.type.replace( /^validate/, "" ), settings = validator.settings; if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) { settings[ eventType ].call( validator, this, event ); } } $( this.currentForm ) .on( "focusin.validate focusout.validate keyup.validate", ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + "[type='radio'], [type='checkbox']", delegate) // Support: Chrome, oldIE // "select" is provided as event.target when clicking a option .on("click.validate", "select, option, [type='radio'], [type='checkbox']", delegate); if ( this.settings.invalidHandler ) { $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler ); } // Add aria-required to any Static/Data/Class required fields before first validation // Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html $( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" ); }, // http://jqueryvalidation.org/Validator.form/ form: function() { this.checkForm(); $.extend( this.submitted, this.errorMap ); this.invalid = $.extend({}, this.errorMap ); if ( !this.valid() ) { $( this.currentForm ).triggerHandler( "invalid-form", [ this ]); } this.showErrors(); return this.valid(); }, checkForm: function() { this.prepareForm(); for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) { this.check( elements[ i ] ); } return this.valid(); }, // http://jqueryvalidation.org/Validator.element/ element: function( element ) { var cleanElement = this.clean( element ), checkElement = this.validationTargetFor( cleanElement ), result = true; this.lastElement = checkElement; if ( checkElement === undefined ) { delete this.invalid[ cleanElement.name ]; } else { this.prepareElement( checkElement ); this.currentElements = $( checkElement ); result = this.check( checkElement ) !== false; if ( result ) { delete this.invalid[ checkElement.name ]; } else { this.invalid[ checkElement.name ] = true; } } // Add aria-invalid status for screen readers $( element ).attr( "aria-invalid", !result ); if ( !this.numberOfInvalids() ) { // Hide error containers on last error this.toHide = this.toHide.add( this.containers ); } this.showErrors(); return result; }, // http://jqueryvalidation.org/Validator.showErrors/ showErrors: function( errors ) { if ( errors ) { // add items to error list and map $.extend( this.errorMap, errors ); this.errorList = []; for ( var name in errors ) { this.errorList.push({ message: errors[ name ], element: this.findByName( name )[ 0 ] }); } // remove items from success list this.successList = $.grep( this.successList, function( element ) { return !( element.name in errors ); }); } if ( this.settings.showErrors ) { this.settings.showErrors.call( this, this.errorMap, this.errorList ); } else { this.defaultShowErrors(); } }, // http://jqueryvalidation.org/Validator.resetForm/ resetForm: function() { if ( $.fn.resetForm ) { $( this.currentForm ).resetForm(); } this.submitted = {}; this.lastElement = null; this.prepareForm(); this.hideErrors(); var i, elements = this.elements() .removeData( "previousValue" ) .removeAttr( "aria-invalid" ); if ( this.settings.unhighlight ) { for ( i = 0; elements[ i ]; i++ ) { this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, "" ); } } else { elements.removeClass( this.settings.errorClass ); } }, numberOfInvalids: function() { return this.objectLength( this.invalid ); }, objectLength: function( obj ) { /* jshint unused: false */ var count = 0, i; for ( i in obj ) { count++; } return count; }, hideErrors: function() { this.hideThese( this.toHide ); }, hideThese: function( errors ) { errors.not( this.containers ).text( "" ); this.addWrapper( errors ).hide(); }, valid: function() { return this.size() === 0; }, size: function() { return this.errorList.length; }, focusInvalid: function() { if ( this.settings.focusInvalid ) { try { $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || []) .filter( ":visible" ) .focus() // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find .trigger( "focusin" ); } catch ( e ) { // ignore IE throwing errors when focusing hidden elements } } }, findLastActive: function() { var lastActive = this.lastActive; return lastActive && $.grep( this.errorList, function( n ) { return n.element.name === lastActive.name; }).length === 1 && lastActive; }, elements: function() { var validator = this, rulesCache = {}; // select all valid inputs inside the form (no submit or reset buttons) return $( this.currentForm ) .find( "input, select, textarea" ) .not( ":submit, :reset, :image, :disabled" ) .not( this.settings.ignore ) .filter( function() { if ( !this.name && validator.settings.debug && window.console ) { console.error( "%o has no name assigned", this ); } // select only the first element for each name, and only those with rules specified if ( this.name in rulesCache || !validator.objectLength( $( this ).rules() ) ) { return false; } rulesCache[ this.name ] = true; return true; }); }, clean: function( selector ) { return $( selector )[ 0 ]; }, errors: function() { var errorClass = this.settings.errorClass.split( " " ).join( "." ); return $( this.settings.errorElement + "." + errorClass, this.errorContext ); }, reset: function() { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = $( [] ); this.toHide = $( [] ); this.currentElements = $( [] ); }, prepareForm: function() { this.reset(); this.toHide = this.errors().add( this.containers ); }, prepareElement: function( element ) { this.reset(); this.toHide = this.errorsFor( element ); }, elementValue: function( element ) { var val, $element = $( element ), type = element.type; if ( type === "radio" || type === "checkbox" ) { return this.findByName( element.name ).filter(":checked").val(); } else if ( type === "number" && typeof element.validity !== "undefined" ) { return element.validity.badInput ? false : $element.val(); } val = $element.val(); if ( typeof val === "string" ) { return val.replace(/\r/g, "" ); } return val; }, check: function( element ) { element = this.validationTargetFor( this.clean( element ) ); var rules = $( element ).rules(), rulesCount = $.map( rules, function( n, i ) { return i; }).length, dependencyMismatch = false, val = this.elementValue( element ), result, method, rule; for ( method in rules ) { rule = { method: method, parameters: rules[ method ] }; try { result = $.validator.methods[ method ].call( this, val, element, rule.parameters ); // if a method indicates that the field is optional and therefore valid, // don't mark it as valid when there are no other rules if ( result === "dependency-mismatch" && rulesCount === 1 ) { dependencyMismatch = true; continue; } dependencyMismatch = false; if ( result === "pending" ) { this.toHide = this.toHide.not( this.errorsFor( element ) ); return; } if ( !result ) { this.formatAndAdd( element, rule ); return false; } } catch ( e ) { if ( this.settings.debug && window.console ) { console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e ); } if ( e instanceof TypeError ) { e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; } throw e; } } if ( dependencyMismatch ) { return; } if ( this.objectLength( rules ) ) { this.successList.push( element ); } return true; }, // return the custom message for the given element and validation method // specified in the element's HTML5 data attribute // return the generic message if present and no method specific message is present customDataMessage: function( element, method ) { return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" ); }, // return the custom message for the given element name and validation method customMessage: function( name, method ) { var m = this.settings.messages[ name ]; return m && ( m.constructor === String ? m : m[ method ]); }, // return the first defined argument, allowing empty strings findDefined: function() { for ( var i = 0; i < arguments.length; i++) { if ( arguments[ i ] !== undefined ) { return arguments[ i ]; } } return undefined; }, defaultMessage: function( element, method ) { return this.findDefined( this.customMessage( element.name, method ), this.customDataMessage( element, method ), // title is never undefined, so handle empty string as undefined !this.settings.ignoreTitle && element.title || undefined, $.validator.messages[ method ], "Warning: No message defined for " + element.name + "" ); }, formatAndAdd: function( element, rule ) { var message = this.defaultMessage( element, rule.method ), theregex = /\$?\{(\d+)\}/g; if ( typeof message === "function" ) { message = message.call( this, rule.parameters, element ); } else if ( theregex.test( message ) ) { message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters ); } this.errorList.push({ message: message, element: element, method: rule.method }); this.errorMap[ element.name ] = message; this.submitted[ element.name ] = message; }, addWrapper: function( toToggle ) { if ( this.settings.wrapper ) { toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); } return toToggle; }, defaultShowErrors: function() { var i, elements, error; for ( i = 0; this.errorList[ i ]; i++ ) { error = this.errorList[ i ]; if ( this.settings.highlight ) { this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); } this.showLabel( error.element, error.message ); } if ( this.errorList.length ) { this.toShow = this.toShow.add( this.containers ); } if ( this.settings.success ) { for ( i = 0; this.successList[ i ]; i++ ) { this.showLabel( this.successList[ i ] ); } } if ( this.settings.unhighlight ) { for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) { this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass ); } } this.toHide = this.toHide.not( this.toShow ); this.hideErrors(); this.addWrapper( this.toShow ).show(); }, validElements: function() { return this.currentElements.not( this.invalidElements() ); }, invalidElements: function() { return $( this.errorList ).map(function() { return this.element; }); }, showLabel: function( element, message ) { var place, group, errorID, error = this.errorsFor( element ), elementID = this.idOrName( element ), describedBy = $( element ).attr( "aria-describedby" ); if ( error.length ) { // refresh error/success class error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); // replace message on existing label error.html( message ); } else { // create error element error = $( "<" + this.settings.errorElement + ">" ) .attr( "id", elementID + "-error" ) .addClass( this.settings.errorClass ) .html( message || "" ); // Maintain reference to the element to be placed into the DOM place = error; if ( this.settings.wrapper ) { // make sure the element is visible, even in IE // actually showing the wrapped element is handled elsewhere place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent(); } if ( this.labelContainer.length ) { this.labelContainer.append( place ); } else if ( this.settings.errorPlacement ) { this.settings.errorPlacement( place, $( element ) ); } else { place.insertAfter( element ); } // Link error back to the element if ( error.is( "label" ) ) { // If the error is a label, then associate using 'for' error.attr( "for", elementID ); } else if ( error.parents( "label[for='" + elementID + "']" ).length === 0 ) { // If the element is not a child of an associated label, then it's necessary // to explicitly apply aria-describedby errorID = error.attr( "id" ).replace( /(:|\.|\[|\]|\$)/g, "\\$1"); // Respect existing non-error aria-describedby if ( !describedBy ) { describedBy = errorID; } else if ( !describedBy.match( new RegExp( "\\b" + errorID + "\\b" ) ) ) { // Add to end of list if not already present describedBy += " " + errorID; } $( element ).attr( "aria-describedby", describedBy ); // If this element is grouped, then assign to all elements in the same group group = this.groups[ element.name ]; if ( group ) { $.each( this.groups, function( name, testgroup ) { if ( testgroup === group ) { $( "[name='" + name + "']", this.currentForm ) .attr( "aria-describedby", error.attr( "id" ) ); } }); } } } if ( !message && this.settings.success ) { error.text( "" ); if ( typeof this.settings.success === "string" ) { error.addClass( this.settings.success ); } else { this.settings.success( error, element ); } } this.toShow = this.toShow.add( error ); }, errorsFor: function( element ) { var name = this.idOrName( element ), describer = $( element ).attr( "aria-describedby" ), selector = "label[for='" + name + "'], label[for='" + name + "'] *"; // aria-describedby should directly reference the error element if ( describer ) { selector = selector + ", #" + describer.replace( /\s+/g, ", #" ); } return this .errors() .filter( selector ); }, idOrName: function( element ) { return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name ); }, validationTargetFor: function( element ) { // If radio/checkbox, validate first element in group instead if ( this.checkable( element ) ) { element = this.findByName( element.name ); } // Always apply ignore filter return $( element ).not( this.settings.ignore )[ 0 ]; }, checkable: function( element ) { return ( /radio|checkbox/i ).test( element.type ); }, findByName: function( name ) { return $( this.currentForm ).find( "[name='" + name + "']" ); }, getLength: function( value, element ) { switch ( element.nodeName.toLowerCase() ) { case "select": return $( "option:selected", element ).length; case "input": if ( this.checkable( element ) ) { return this.findByName( element.name ).filter( ":checked" ).length; } } return value.length; }, depend: function( param, element ) { return this.dependTypes[typeof param] ? this.dependTypes[typeof param]( param, element ) : true; }, dependTypes: { "boolean": function( param ) { return param; }, "string": function( param, element ) { return !!$( param, element.form ).length; }, "function": function( param, element ) { return param( element ); } }, optional: function( element ) { var val = this.elementValue( element ); return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch"; }, startRequest: function( element ) { if ( !this.pending[ element.name ] ) { this.pendingRequest++; this.pending[ element.name ] = true; } }, stopRequest: function( element, valid ) { this.pendingRequest--; // sometimes synchronization fails, make sure pendingRequest is never < 0 if ( this.pendingRequest < 0 ) { this.pendingRequest = 0; } delete this.pending[ element.name ]; if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) { $( this.currentForm ).submit(); this.formSubmitted = false; } else if (!valid && this.pendingRequest === 0 && this.formSubmitted ) { $( this.currentForm ).triggerHandler( "invalid-form", [ this ]); this.formSubmitted = false; } }, previousValue: function( element ) { return $.data( element, "previousValue" ) || $.data( element, "previousValue", { old: null, valid: true, message: this.defaultMessage( element, "remote" ) }); }, // cleans up all forms and elements, removes validator-specific events destroy: function() { this.resetForm(); $( this.currentForm ) .off( ".validate" ) .removeData( "validator" ); } }, classRuleSettings: { required: { required: true }, email: { email: true }, url: { url: true }, date: { date: true }, dateISO: { dateISO: true }, number: { number: true }, digits: { digits: true }, creditcard: { creditcard: true } }, addClassRules: function( className, rules ) { if ( className.constructor === String ) { this.classRuleSettings[ className ] = rules; } else { $.extend( this.classRuleSettings, className ); } }, classRules: function( element ) { var rules = {}, classes = $( element ).attr( "class" ); if ( classes ) { $.each( classes.split( " " ), function() { if ( this in $.validator.classRuleSettings ) { $.extend( rules, $.validator.classRuleSettings[ this ]); } }); } return rules; }, normalizeAttributeRule: function( rules, type, method, value ) { // convert the value to a number for number inputs, and for text for backwards compability // allows type="date" and others to be compared as strings if ( /min|max/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) { value = Number( value ); // Support Opera Mini, which returns NaN for undefined minlength if ( isNaN( value ) ) { value = undefined; } } if ( value || value === 0 ) { rules[ method ] = value; } else if ( type === method && type !== "range" ) { // exception: the jquery validate 'range' method // does not test for the html5 'range' type rules[ method ] = true; } }, attributeRules: function( element ) { var rules = {}, $element = $( element ), type = element.getAttribute( "type" ), method, value; for ( method in $.validator.methods ) { // support for in both html5 and older browsers if ( method === "required" ) { value = element.getAttribute( method ); // Some browsers return an empty string for the required attribute // and non-HTML5 browsers might have required="" markup if ( value === "" ) { value = true; } // force non-HTML5 browsers to return bool value = !!value; } else { value = $element.attr( method ); } this.normalizeAttributeRule( rules, type, method, value ); } // maxlength may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) { delete rules.maxlength; } return rules; }, dataRules: function( element ) { var rules = {}, $element = $( element ), type = element.getAttribute( "type" ), method, value; for ( method in $.validator.methods ) { value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ); this.normalizeAttributeRule( rules, type, method, value ); } return rules; }, staticRules: function( element ) { var rules = {}, validator = $.data( element.form, "validator" ); if ( validator.settings.rules ) { rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {}; } return rules; }, normalizeRules: function( rules, element ) { // handle dependency check $.each( rules, function( prop, val ) { // ignore rule when param is explicitly false, eg. required:false if ( val === false ) { delete rules[ prop ]; return; } if ( val.param || val.depends ) { var keepRule = true; switch ( typeof val.depends ) { case "string": keepRule = !!$( val.depends, element.form ).length; break; case "function": keepRule = val.depends.call( element, element ); break; } if ( keepRule ) { rules[ prop ] = val.param !== undefined ? val.param : true; } else { delete rules[ prop ]; } } }); // evaluate parameters $.each( rules, function( rule, parameter ) { rules[ rule ] = $.isFunction( parameter ) ? parameter( element ) : parameter; }); // clean number parameters $.each([ "minlength", "maxlength" ], function() { if ( rules[ this ] ) { rules[ this ] = Number( rules[ this ] ); } }); $.each([ "rangelength", "range" ], function() { var parts; if ( rules[ this ] ) { if ( $.isArray( rules[ this ] ) ) { rules[ this ] = [ Number( rules[ this ][ 0 ]), Number( rules[ this ][ 1 ] ) ]; } else if ( typeof rules[ this ] === "string" ) { parts = rules[ this ].replace(/[\[\]]/g, "" ).split( /[\s,]+/ ); rules[ this ] = [ Number( parts[ 0 ]), Number( parts[ 1 ] ) ]; } } }); if ( $.validator.autoCreateRanges ) { // auto-create ranges if ( rules.min != null && rules.max != null ) { rules.range = [ rules.min, rules.max ]; delete rules.min; delete rules.max; } if ( rules.minlength != null && rules.maxlength != null ) { rules.rangelength = [ rules.minlength, rules.maxlength ]; delete rules.minlength; delete rules.maxlength; } } return rules; }, // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} normalizeRule: function( data ) { if ( typeof data === "string" ) { var transformed = {}; $.each( data.split( /\s/ ), function() { transformed[ this ] = true; }); data = transformed; } return data; }, // http://jqueryvalidation.org/jQuery.validator.addMethod/ addMethod: function( name, method, message ) { $.validator.methods[ name ] = method; $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ]; if ( method.length < 3 ) { $.validator.addClassRules( name, $.validator.normalizeRule( name ) ); } }, methods: { // http://jqueryvalidation.org/required-method/ required: function( value, element, param ) { // check if dependency is met if ( !this.depend( param, element ) ) { return "dependency-mismatch"; } if ( element.nodeName.toLowerCase() === "select" ) { // could be an array for select-multiple or a string, both are fine this way var val = $( element ).val(); return val && val.length > 0; } if ( this.checkable( element ) ) { return this.getLength( value, element ) > 0; } return value.length > 0; }, // http://jqueryvalidation.org/email-method/ email: function( value, element ) { // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address // Retrieved 2014-01-14 // If you have a problem with this implementation, report a bug against the above spec // Or use custom methods to implement your own email validation return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value ); }, // http://jqueryvalidation.org/url-method/ url: function( value, element ) { // Copyright (c) 2010-2013 Diego Perini, MIT licensed // https://gist.github.com/dperini/729294 // see also https://mathiasbynens.be/demo/url-regex // modified to allow protocol-relative URLs return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value ); }, // http://jqueryvalidation.org/date-method/ date: function( value, element ) { return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); }, // http://jqueryvalidation.org/dateISO-method/ dateISO: function( value, element ) { return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); }, // http://jqueryvalidation.org/number-method/ number: function( value, element ) { return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value ); }, // http://jqueryvalidation.org/digits-method/ digits: function( value, element ) { return this.optional( element ) || /^\d+$/.test( value ); }, // http://jqueryvalidation.org/creditcard-method/ // based on http://en.wikipedia.org/wiki/Luhn_algorithm creditcard: function( value, element ) { if ( this.optional( element ) ) { return "dependency-mismatch"; } // accept only spaces, digits and dashes if ( /[^0-9 \-]+/.test( value ) ) { return false; } var nCheck = 0, nDigit = 0, bEven = false, n, cDigit; value = value.replace( /\D/g, "" ); // Basing min and max length on // http://developer.ean.com/general_info/Valid_Credit_Card_Types if ( value.length < 13 || value.length > 19 ) { return false; } for ( n = value.length - 1; n >= 0; n--) { cDigit = value.charAt( n ); nDigit = parseInt( cDigit, 10 ); if ( bEven ) { if ( ( nDigit *= 2 ) > 9 ) { nDigit -= 9; } } nCheck += nDigit; bEven = !bEven; } return ( nCheck % 10 ) === 0; }, // http://jqueryvalidation.org/minlength-method/ minlength: function( value, element, param ) { var length = $.isArray( value ) ? value.length : this.getLength( value, element ); return this.optional( element ) || length >= param; }, // http://jqueryvalidation.org/maxlength-method/ maxlength: function( value, element, param ) { var length = $.isArray( value ) ? value.length : this.getLength( value, element ); return this.optional( element ) || length <= param; }, // http://jqueryvalidation.org/rangelength-method/ rangelength: function( value, element, param ) { var length = $.isArray( value ) ? value.length : this.getLength( value, element ); return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); }, // http://jqueryvalidation.org/min-method/ min: function( value, element, param ) { return this.optional( element ) || value >= param; }, // http://jqueryvalidation.org/max-method/ max: function( value, element, param ) { return this.optional( element ) || value <= param; }, // http://jqueryvalidation.org/range-method/ range: function( value, element, param ) { return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); }, // http://jqueryvalidation.org/equalTo-method/ equalTo: function( value, element, param ) { // bind to the blur event of the target in order to revalidate whenever the target field is updated // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead var target = $( param ); if ( this.settings.onfocusout ) { target.off( ".validate-equalTo" ).on( "blur.validate-equalTo", function() { $( element ).valid(); }); } return value === target.val(); }, // http://jqueryvalidation.org/remote-method/ remote: function( value, element, param ) { if ( this.optional( element ) ) { return "dependency-mismatch"; } var previous = this.previousValue( element ), validator, data; if (!this.settings.messages[ element.name ] ) { this.settings.messages[ element.name ] = {}; } previous.originalMessage = this.settings.messages[ element.name ].remote; this.settings.messages[ element.name ].remote = previous.message; param = typeof param === "string" && { url: param } || param; if ( previous.old === value ) { return previous.valid; } previous.old = value; validator = this; this.startRequest( element ); data = {}; data[ element.name ] = value; $.ajax( $.extend( true, { mode: "abort", port: "validate" + element.name, dataType: "json", data: data, context: validator.currentForm, success: function( response ) { var valid = response === true || response === "true", errors, message, submitted; validator.settings.messages[ element.name ].remote = previous.originalMessage; if ( valid ) { submitted = validator.formSubmitted; validator.prepareElement( element ); validator.formSubmitted = submitted; validator.successList.push( element ); delete validator.invalid[ element.name ]; validator.showErrors(); } else { errors = {}; message = response || validator.defaultMessage( element, "remote" ); errors[ element.name ] = previous.message = $.isFunction( message ) ? message( value ) : message; validator.invalid[ element.name ] = true; validator.showErrors( errors ); } previous.valid = valid; validator.stopRequest( element, valid ); } }, param ) ); return "pending"; } } }); // ajax mode: abort // usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); // if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() var pendingRequests = {}, ajax; // Use a prefilter if available (1.5+) if ( $.ajaxPrefilter ) { $.ajaxPrefilter(function( settings, _, xhr ) { var port = settings.port; if ( settings.mode === "abort" ) { if ( pendingRequests[port] ) { pendingRequests[port].abort(); } pendingRequests[port] = xhr; } }); } else { // Proxy ajax ajax = $.ajax; $.ajax = function( settings ) { var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, port = ( "port" in settings ? settings : $.ajaxSettings ).port; if ( mode === "abort" ) { if ( pendingRequests[port] ) { pendingRequests[port].abort(); } pendingRequests[port] = ajax.apply(this, arguments); return pendingRequests[port]; } return ajax.apply(this, arguments); }; } })); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/package.json ================================================ { "name": "jquery-validation", "title": "jQuery Validation Plugin", "description": "Client-side form validation made easy", "version": "1.14.0", "homepage": "http://jqueryvalidation.org/", "license": "MIT", "author": { "name": "Jörn Zaefferer", "email": "joern.zaefferer@gmail.com", "url": "http://bassistance.de" }, "repository": { "type": "git", "url": "git://github.com/jzaefferer/jquery-validation.git" }, "bugs": { "url": "https://github.com/jzaefferer/jquery-validation/issues" }, "licenses": [ { "type": "MIT", "url": "http://www.opensource.org/licenses/MIT" } ], "scripts": { "test": "grunt", "prepublish": "grunt" }, "files": [ "dist/localization/", "dist/additional-methods.js", "dist/jquery.validate.js" ], "main": "dist/jquery.validate.js", "dependencies": {}, "devDependencies": { "commitplease": "2.0.0", "grunt": "0.4.4", "grunt-contrib-compress": "0.7.0", "grunt-contrib-concat": "0.3.0", "grunt-contrib-copy": "0.5.0", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-qunit": "0.4.0", "grunt-contrib-uglify": "0.4.0", "grunt-contrib-watch": "0.6.0", "grunt-jscs": "1.0.0", "grunt-text-replace": "0.3.11" }, "keywords": [ "jquery", "jquery-plugin", "forms", "validation", "validate" ] } ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/accept.js ================================================ // Accept a value from a file input based on a required mimetype $.validator.addMethod("accept", function(value, element, param) { // Split mime on commas in case we have multiple types we can accept var typeParam = typeof param === "string" ? param.replace(/\s/g, "").replace(/,/g, "|") : "image/*", optionalValue = this.optional(element), i, file; // Element is optional if (optionalValue) { return optionalValue; } if ($(element).attr("type") === "file") { // If we are using a wildcard, make it regex friendly typeParam = typeParam.replace(/\*/g, ".*"); // Check if the element has a FileList before checking each file if (element.files && element.files.length) { for (i = 0; i < element.files.length; i++) { file = element.files[i]; // Grab the mimetype from the loaded file, verify it matches if (!file.type.match(new RegExp( "\\.?(" + typeParam + ")$", "i"))) { return false; } } } } // Either return true because we've validated each file, or because the // browser does not support element.files and the FileList feature return true; }, $.validator.format("Please enter a value with a valid mimetype.")); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/additional.js ================================================ (function() { function stripHtml(value) { // remove html tags and space chars return value.replace(/<.[^<>]*?>/g, " ").replace(/ | /gi, " ") // remove punctuation .replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g, ""); } $.validator.addMethod("maxWords", function(value, element, params) { return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length <= params; }, $.validator.format("Please enter {0} words or less.")); $.validator.addMethod("minWords", function(value, element, params) { return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params; }, $.validator.format("Please enter at least {0} words.")); $.validator.addMethod("rangeWords", function(value, element, params) { var valueStripped = stripHtml(value), regex = /\b\w+\b/g; return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1]; }, $.validator.format("Please enter between {0} and {1} words.")); }()); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/alphanumeric.js ================================================ $.validator.addMethod("alphanumeric", function(value, element) { return this.optional(element) || /^\w+$/i.test(value); }, "Letters, numbers, and underscores only please"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/bankaccountNL.js ================================================ /* * Dutch bank account numbers (not 'giro' numbers) have 9 digits * and pass the '11 check'. * We accept the notation with spaces, as that is common. * acceptable: 123456789 or 12 34 56 789 */ $.validator.addMethod("bankaccountNL", function(value, element) { if (this.optional(element)) { return true; } if (!(/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value))) { return false; } // now '11 check' var account = value.replace(/ /g, ""), // remove spaces sum = 0, len = account.length, pos, factor, digit; for ( pos = 0; pos < len; pos++ ) { factor = len - pos; digit = account.substring(pos, pos + 1); sum = sum + factor * digit; } return sum % 11 === 0; }, "Please specify a valid bank account number"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/bankorgiroaccountNL.js ================================================ $.validator.addMethod("bankorgiroaccountNL", function(value, element) { return this.optional(element) || ($.validator.methods.bankaccountNL.call(this, value, element)) || ($.validator.methods.giroaccountNL.call(this, value, element)); }, "Please specify a valid bank or giro account number"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/bic.js ================================================ /** * BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity. * * BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional) * * BIC definition in detail: * - First 4 characters - bank code (only letters) * - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters) * - Next 2 characters - location code (letters and digits) * a. shall not start with '0' or '1' * b. second character must be a letter ('O' is not allowed) or one of the following digits ('0' for test (therefore not allowed), '1' for passive participant and '2' for active participant) * - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits) */ $.validator.addMethod("bic", function(value, element) { return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value ); }, "Please specify a valid BIC code"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/cifES.js ================================================ /* * Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities * Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal */ $.validator.addMethod( "cifES", function( value ) { "use strict"; var num = [], controlDigit, sum, i, count, tmp, secondDigit; value = value.toUpperCase(); // Quick format test if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { return false; } for ( i = 0; i < 9; i++ ) { num[ i ] = parseInt( value.charAt( i ), 10 ); } // Algorithm for checking CIF codes sum = num[ 2 ] + num[ 4 ] + num[ 6 ]; for ( count = 1; count < 8; count += 2 ) { tmp = ( 2 * num[ count ] ).toString(); secondDigit = tmp.charAt( 1 ); sum += parseInt( tmp.charAt( 0 ), 10 ) + ( secondDigit === "" ? 0 : parseInt( secondDigit, 10 ) ); } /* The first (position 1) is a letter following the following criteria: * A. Corporations * B. LLCs * C. General partnerships * D. Companies limited partnerships * E. Communities of goods * F. Cooperative Societies * G. Associations * H. Communities of homeowners in horizontal property regime * J. Civil Societies * K. Old format * L. Old format * M. Old format * N. Nonresident entities * P. Local authorities * Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions * R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008) * S. Organs of State Administration and regions * V. Agrarian Transformation * W. Permanent establishments of non-resident in Spain */ if ( /^[ABCDEFGHJNPQRSUVW]{1}/.test( value ) ) { sum += ""; controlDigit = 10 - parseInt( sum.charAt( sum.length - 1 ), 10 ); value += controlDigit; return ( num[ 8 ].toString() === String.fromCharCode( 64 + controlDigit ) || num[ 8 ].toString() === value.charAt( value.length - 1 ) ); } return false; }, "Please specify a valid CIF number." ); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/cpfBR.js ================================================ /* * Brazillian CPF number (Cadastrado de Pessoas Físicas) is the equivalent of a Brazilian tax registration number. * CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. */ $.validator.addMethod("cpfBR", function(value) { // Removing special characters from value value = value.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, ""); // Checking value to have 11 digits only if (value.length !== 11) { return false; } var sum = 0, firstCN, secondCN, checkResult, i; firstCN = parseInt(value.substring(9, 10), 10); secondCN = parseInt(value.substring(10, 11), 10); checkResult = function(sum, cn) { var result = (sum * 10) % 11; if ((result === 10) || (result === 11)) {result = 0;} return (result === cn); }; // Checking for dump data if (value === "" || value === "00000000000" || value === "11111111111" || value === "22222222222" || value === "33333333333" || value === "44444444444" || value === "55555555555" || value === "66666666666" || value === "77777777777" || value === "88888888888" || value === "99999999999" ) { return false; } // Step 1 - using first Check Number: for ( i = 1; i <= 9; i++ ) { sum = sum + parseInt(value.substring(i - 1, i), 10) * (11 - i); } // If first Check Number (CN) is valid, move to Step 2 - using second Check Number: if ( checkResult(sum, firstCN) ) { sum = 0; for ( i = 1; i <= 10; i++ ) { sum = sum + parseInt(value.substring(i - 1, i), 10) * (12 - i); } return checkResult(sum, secondCN); } return false; }, "Please specify a valid CPF number"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/creditcardtypes.js ================================================ /* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator * Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 * Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings) */ $.validator.addMethod("creditcardtypes", function(value, element, param) { if (/[^0-9\-]+/.test(value)) { return false; } value = value.replace(/\D/g, ""); var validTypes = 0x0000; if (param.mastercard) { validTypes |= 0x0001; } if (param.visa) { validTypes |= 0x0002; } if (param.amex) { validTypes |= 0x0004; } if (param.dinersclub) { validTypes |= 0x0008; } if (param.enroute) { validTypes |= 0x0010; } if (param.discover) { validTypes |= 0x0020; } if (param.jcb) { validTypes |= 0x0040; } if (param.unknown) { validTypes |= 0x0080; } if (param.all) { validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080; } if (validTypes & 0x0001 && /^(5[12345])/.test(value)) { //mastercard return value.length === 16; } if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa return value.length === 16; } if (validTypes & 0x0004 && /^(3[47])/.test(value)) { //amex return value.length === 15; } if (validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test(value)) { //dinersclub return value.length === 14; } if (validTypes & 0x0010 && /^(2(014|149))/.test(value)) { //enroute return value.length === 15; } if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover return value.length === 16; } if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb return value.length === 16; } if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb return value.length === 15; } if (validTypes & 0x0080) { //unknown return true; } return false; }, "Please enter a valid credit card number."); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/currency.js ================================================ /** * Validates currencies with any given symbols by @jameslouiz * Symbols can be optional or required. Symbols required by default * * Usage examples: * currency: ["£", false] - Use false for soft currency validation * currency: ["$", false] * currency: ["RM", false] - also works with text based symbols such as "RM" - Malaysia Ringgit etc * * * * Soft symbol checking * currencyInput: { * currency: ["$", false] * } * * Strict symbol checking (default) * currencyInput: { * currency: "$" * //OR * currency: ["$", true] * } * * Multiple Symbols * currencyInput: { * currency: "$,£,¢" * } */ $.validator.addMethod("currency", function(value, element, param) { var isParamString = typeof param === "string", symbol = isParamString ? param : param[0], soft = isParamString ? true : param[1], regex; symbol = symbol.replace(/,/g, ""); symbol = soft ? symbol + "]" : symbol + "]?"; regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$"; regex = new RegExp(regex); return this.optional(element) || regex.test(value); }, "Please specify a valid currency"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/dateFA.js ================================================ $.validator.addMethod("dateFA", function(value, element) { return this.optional(element) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(value); }, $.validator.messages.date); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/dateITA.js ================================================ /** * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy. * * @example $.validator.methods.date("01/01/1900") * @result true * * @example $.validator.methods.date("01/13/1990") * @result false * * @example $.validator.methods.date("01.01.1900") * @result false * * @example * @desc Declares an optional input element whose value must be a valid date. * * @name $.validator.methods.dateITA * @type Boolean * @cat Plugins/Validate/Methods */ $.validator.addMethod("dateITA", function(value, element) { var check = false, re = /^\d{1,2}\/\d{1,2}\/\d{4}$/, adata, gg, mm, aaaa, xdata; if ( re.test(value)) { adata = value.split("/"); gg = parseInt(adata[0], 10); mm = parseInt(adata[1], 10); aaaa = parseInt(adata[2], 10); xdata = new Date(Date.UTC(aaaa, mm - 1, gg, 12, 0, 0, 0)); if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth () === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) { check = true; } else { check = false; } } else { check = false; } return this.optional(element) || check; }, $.validator.messages.date); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/dateNL.js ================================================ $.validator.addMethod("dateNL", function(value, element) { return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value); }, $.validator.messages.date); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/extension.js ================================================ // Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept $.validator.addMethod("extension", function(value, element, param) { param = typeof param === "string" ? param.replace(/,/g, "|") : "png|jpe?g|gif"; return this.optional(element) || value.match(new RegExp("\\.(" + param + ")$", "i")); }, $.validator.format("Please enter a value with a valid extension.")); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/giroaccountNL.js ================================================ /** * Dutch giro account numbers (not bank numbers) have max 7 digits */ $.validator.addMethod("giroaccountNL", function(value, element) { return this.optional(element) || /^[0-9]{1,7}$/.test(value); }, "Please specify a valid giro account number"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/iban.js ================================================ /** * IBAN is the international bank account number. * It has a country - specific format, that is checked here too */ $.validator.addMethod("iban", function(value, element) { // some quick simple tests to prevent needless work if (this.optional(element)) { return true; } // remove spaces and to upper case var iban = value.replace(/ /g, "").toUpperCase(), ibancheckdigits = "", leadingZeroes = true, cRest = "", cOperator = "", countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p; // check the country code and find the country specific format countrycode = iban.substring(0, 2); bbancountrypatterns = { "AL": "\\d{8}[\\dA-Z]{16}", "AD": "\\d{8}[\\dA-Z]{12}", "AT": "\\d{16}", "AZ": "[\\dA-Z]{4}\\d{20}", "BE": "\\d{12}", "BH": "[A-Z]{4}[\\dA-Z]{14}", "BA": "\\d{16}", "BR": "\\d{23}[A-Z][\\dA-Z]", "BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}", "CR": "\\d{17}", "HR": "\\d{17}", "CY": "\\d{8}[\\dA-Z]{16}", "CZ": "\\d{20}", "DK": "\\d{14}", "DO": "[A-Z]{4}\\d{20}", "EE": "\\d{16}", "FO": "\\d{14}", "FI": "\\d{14}", "FR": "\\d{10}[\\dA-Z]{11}\\d{2}", "GE": "[\\dA-Z]{2}\\d{16}", "DE": "\\d{18}", "GI": "[A-Z]{4}[\\dA-Z]{15}", "GR": "\\d{7}[\\dA-Z]{16}", "GL": "\\d{14}", "GT": "[\\dA-Z]{4}[\\dA-Z]{20}", "HU": "\\d{24}", "IS": "\\d{22}", "IE": "[\\dA-Z]{4}\\d{14}", "IL": "\\d{19}", "IT": "[A-Z]\\d{10}[\\dA-Z]{12}", "KZ": "\\d{3}[\\dA-Z]{13}", "KW": "[A-Z]{4}[\\dA-Z]{22}", "LV": "[A-Z]{4}[\\dA-Z]{13}", "LB": "\\d{4}[\\dA-Z]{20}", "LI": "\\d{5}[\\dA-Z]{12}", "LT": "\\d{16}", "LU": "\\d{3}[\\dA-Z]{13}", "MK": "\\d{3}[\\dA-Z]{10}\\d{2}", "MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}", "MR": "\\d{23}", "MU": "[A-Z]{4}\\d{19}[A-Z]{3}", "MC": "\\d{10}[\\dA-Z]{11}\\d{2}", "MD": "[\\dA-Z]{2}\\d{18}", "ME": "\\d{18}", "NL": "[A-Z]{4}\\d{10}", "NO": "\\d{11}", "PK": "[\\dA-Z]{4}\\d{16}", "PS": "[\\dA-Z]{4}\\d{21}", "PL": "\\d{24}", "PT": "\\d{21}", "RO": "[A-Z]{4}[\\dA-Z]{16}", "SM": "[A-Z]\\d{10}[\\dA-Z]{12}", "SA": "\\d{2}[\\dA-Z]{18}", "RS": "\\d{18}", "SK": "\\d{20}", "SI": "\\d{15}", "ES": "\\d{20}", "SE": "\\d{20}", "CH": "\\d{5}[\\dA-Z]{12}", "TN": "\\d{20}", "TR": "\\d{5}[\\dA-Z]{17}", "AE": "\\d{3}\\d{16}", "GB": "[A-Z]{4}\\d{14}", "VG": "[\\dA-Z]{4}\\d{16}" }; bbanpattern = bbancountrypatterns[countrycode]; // As new countries will start using IBAN in the // future, we only check if the countrycode is known. // This prevents false negatives, while almost all // false positives introduced by this, will be caught // by the checksum validation below anyway. // Strict checking should return FALSE for unknown // countries. if (typeof bbanpattern !== "undefined") { ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", ""); if (!(ibanregexp.test(iban))) { return false; // invalid country specific format } } // now check the checksum, first convert to digits ibancheck = iban.substring(4, iban.length) + iban.substring(0, 4); for (i = 0; i < ibancheck.length; i++) { charAt = ibancheck.charAt(i); if (charAt !== "0") { leadingZeroes = false; } if (!leadingZeroes) { ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt); } } // calculate the result of: ibancheckdigits % 97 for (p = 0; p < ibancheckdigits.length; p++) { cChar = ibancheckdigits.charAt(p); cOperator = "" + cRest + "" + cChar; cRest = cOperator % 97; } return cRest === 1; }, "Please specify a valid IBAN"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/integer.js ================================================ $.validator.addMethod("integer", function(value, element) { return this.optional(element) || /^-?\d+$/.test(value); }, "A positive or negative non-decimal number please"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/ipv4.js ================================================ $.validator.addMethod("ipv4", function(value, element) { return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value); }, "Please enter a valid IP v4 address."); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/ipv6.js ================================================ $.validator.addMethod("ipv6", function(value, element) { return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value); }, "Please enter a valid IP v6 address."); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/lettersonly.js ================================================ $.validator.addMethod("lettersonly", function(value, element) { return this.optional(element) || /^[a-z]+$/i.test(value); }, "Letters only please"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/letterswithbasicpunc.js ================================================ $.validator.addMethod("letterswithbasicpunc", function(value, element) { return this.optional(element) || /^[a-z\-.,()'"\s]+$/i.test(value); }, "Letters or punctuation only please"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/mobileNL.js ================================================ $.validator.addMethod("mobileNL", function(value, element) { return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(value); }, "Please specify a valid mobile number"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/mobileUK.js ================================================ /* For UK phone functions, do the following server side processing: * Compare original input with this RegEx pattern: * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0' * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. * A number of very detailed GB telephone number RegEx patterns can also be found at: * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers */ $.validator.addMethod("mobileUK", function(phone_number, element) { phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/); }, "Please specify a valid mobile number"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/nieES.js ================================================ /* * The número de identidad de extranjero ( NIE )is a code used to identify the non-nationals in Spain */ $.validator.addMethod( "nieES", function( value ) { "use strict"; value = value.toUpperCase(); // Basic format test if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { return false; } // Test NIE //T if ( /^[T]{1}/.test( value ) ) { return ( value[ 8 ] === /^[T]{1}[A-Z0-9]{8}$/.test( value ) ); } //XYZ if ( /^[XYZ]{1}/.test( value ) ) { return ( value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.replace( "X", "0" ) .replace( "Y", "1" ) .replace( "Z", "2" ) .substring( 0, 8 ) % 23 ) ); } return false; }, "Please specify a valid NIE number." ); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/nifES.js ================================================ /* * The Número de Identificación Fiscal ( NIF ) is the way tax identification used in Spain for individuals */ $.validator.addMethod( "nifES", function( value ) { "use strict"; value = value.toUpperCase(); // Basic format test if ( !value.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)") ) { return false; } // Test NIF if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) { return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) ); } // Test specials NIF (starts with K, L or M) if ( /^[KLM]{1}/.test( value ) ) { return ( value[ 8 ] === String.fromCharCode( 64 ) ); } return false; }, "Please specify a valid NIF number." ); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/notEqualTo.js ================================================ jQuery.validator.addMethod( "notEqualTo", function( value, element, param ) { return this.optional(element) || !$.validator.methods.equalTo.call( this, value, element, param ); }, "Please enter a different value, values must not be the same." ); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/nowhitespace.js ================================================ $.validator.addMethod("nowhitespace", function(value, element) { return this.optional(element) || /^\S+$/i.test(value); }, "No white space please"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/pattern.js ================================================ /** * Return true if the field value matches the given format RegExp * * @example $.validator.methods.pattern("AR1004",element,/^AR\d{4}$/) * @result true * * @example $.validator.methods.pattern("BR1004",element,/^AR\d{4}$/) * @result false * * @name $.validator.methods.pattern * @type Boolean * @cat Plugins/Validate/Methods */ $.validator.addMethod("pattern", function(value, element, param) { if (this.optional(element)) { return true; } if (typeof param === "string") { param = new RegExp("^(?:" + param + ")$"); } return param.test(value); }, "Invalid format."); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/phoneNL.js ================================================ /** * Dutch phone numbers have 10 digits (or 11 and start with +31). */ $.validator.addMethod("phoneNL", function(value, element) { return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(value); }, "Please specify a valid phone number."); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/phoneUK.js ================================================ /* For UK phone functions, do the following server side processing: * Compare original input with this RegEx pattern: * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0' * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. * A number of very detailed GB telephone number RegEx patterns can also be found at: * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers */ $.validator.addMethod("phoneUK", function(phone_number, element) { phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/); }, "Please specify a valid phone number"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/phoneUS.js ================================================ /** * matches US phone number format * * where the area code may not start with 1 and the prefix may not start with 1 * allows '-' or ' ' as a separator and allows parens around area code * some people may want to put a '1' in front of their number * * 1(212)-999-2345 or * 212 999 2344 or * 212-999-0983 * * but not * 111-123-5434 * and not * 212 123 4567 */ $.validator.addMethod("phoneUS", function(phone_number, element) { phone_number = phone_number.replace(/\s+/g, ""); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/); }, "Please specify a valid phone number"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/phonesUK.js ================================================ /* For UK phone functions, do the following server side processing: * Compare original input with this RegEx pattern: * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0' * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. * A number of very detailed GB telephone number RegEx patterns can also be found at: * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers */ //Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers $.validator.addMethod("phonesUK", function(phone_number, element) { phone_number = phone_number.replace(/\(|\)|\s+|-/g, ""); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/); }, "Please specify a valid uk phone number"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/postalCodeCA.js ================================================ /** * Matches a valid Canadian Postal Code * * @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element ) * @result true * * @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element ) * @result false * * @name jQuery.validator.methods.postalCodeCA * @type Boolean * @cat Plugins/Validate/Methods */ $.validator.addMethod( "postalCodeCA", function( value, element ) { return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test( value ); }, "Please specify a valid postal code" ); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/postalcodeBR.js ================================================ /* * Valida CEPs do brasileiros: * * Formatos aceitos: * 99999-999 * 99.999-999 * 99999999 */ $.validator.addMethod("postalcodeBR", function(cep_value, element) { return this.optional(element) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value ); }, "Informe um CEP válido."); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/postalcodeIT.js ================================================ /* Matches Italian postcode (CAP) */ $.validator.addMethod("postalcodeIT", function(value, element) { return this.optional(element) || /^\d{5}$/.test(value); }, "Please specify a valid postal code"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/postalcodeNL.js ================================================ $.validator.addMethod("postalcodeNL", function(value, element) { return this.optional(element) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(value); }, "Please specify a valid postal code"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/postcodeUK.js ================================================ // Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK) $.validator.addMethod("postcodeUK", function(value, element) { return this.optional(element) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(value); }, "Please specify a valid UK postcode"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/require_from_group.js ================================================ /* * Lets you say "at least X inputs that match selector Y must be filled." * * The end result is that neither of these inputs: * * * * * ...will validate unless at least one of them is filled. * * partnumber: {require_from_group: [1,".productinfo"]}, * description: {require_from_group: [1,".productinfo"]} * * options[0]: number of fields that must be filled in the group * options[1]: CSS selector that defines the group of conditionally required fields */ $.validator.addMethod("require_from_group", function(value, element, options) { var $fields = $(options[1], element.form), $fieldsFirst = $fields.eq(0), validator = $fieldsFirst.data("valid_req_grp") ? $fieldsFirst.data("valid_req_grp") : $.extend({}, this), isValid = $fields.filter(function() { return validator.elementValue(this); }).length >= options[0]; // Store the cloned validator for future validation $fieldsFirst.data("valid_req_grp", validator); // If element isn't being validated, run each require_from_group field's validation rules if (!$(element).data("being_validated")) { $fields.data("being_validated", true); $fields.each(function() { validator.element(this); }); $fields.data("being_validated", false); } return isValid; }, $.validator.format("Please fill at least {0} of these fields.")); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/skip_or_fill_minimum.js ================================================ /* * Lets you say "either at least X inputs that match selector Y must be filled, * OR they must all be skipped (left blank)." * * The end result, is that none of these inputs: * * * * * * ...will validate unless either at least two of them are filled, * OR none of them are. * * partnumber: {skip_or_fill_minimum: [2,".productinfo"]}, * description: {skip_or_fill_minimum: [2,".productinfo"]}, * color: {skip_or_fill_minimum: [2,".productinfo"]} * * options[0]: number of fields that must be filled in the group * options[1]: CSS selector that defines the group of conditionally required fields * */ $.validator.addMethod("skip_or_fill_minimum", function(value, element, options) { var $fields = $(options[1], element.form), $fieldsFirst = $fields.eq(0), validator = $fieldsFirst.data("valid_skip") ? $fieldsFirst.data("valid_skip") : $.extend({}, this), numberFilled = $fields.filter(function() { return validator.elementValue(this); }).length, isValid = numberFilled === 0 || numberFilled >= options[0]; // Store the cloned validator for future validation $fieldsFirst.data("valid_skip", validator); // If element isn't being validated, run each skip_or_fill_minimum field's validation rules if (!$(element).data("being_validated")) { $fields.data("being_validated", true); $fields.each(function() { validator.element(this); }); $fields.data("being_validated", false); } return isValid; }, $.validator.format("Please either skip these fields or fill at least {0} of them.")); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/statesUS.js ================================================ /* Validates US States and/or Territories by @jdforsythe * Can be case insensitive or require capitalization - default is case insensitive * Can include US Territories or not - default does not * Can include US Military postal abbreviations (AA, AE, AP) - default does not * * Note: "States" always includes DC (District of Colombia) * * Usage examples: * * This is the default - case insensitive, no territories, no military zones * stateInput: { * caseSensitive: false, * includeTerritories: false, * includeMilitary: false * } * * Only allow capital letters, no territories, no military zones * stateInput: { * caseSensitive: false * } * * Case insensitive, include territories but not military zones * stateInput: { * includeTerritories: true * } * * Only allow capital letters, include territories and military zones * stateInput: { * caseSensitive: true, * includeTerritories: true, * includeMilitary: true * } * * * */ $.validator.addMethod("stateUS", function(value, element, options) { var isDefault = typeof options === "undefined", caseSensitive = ( isDefault || typeof options.caseSensitive === "undefined" ) ? false : options.caseSensitive, includeTerritories = ( isDefault || typeof options.includeTerritories === "undefined" ) ? false : options.includeTerritories, includeMilitary = ( isDefault || typeof options.includeMilitary === "undefined" ) ? false : options.includeMilitary, regex; if (!includeTerritories && !includeMilitary) { regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; } else if (includeTerritories && includeMilitary) { regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; } else if (includeTerritories) { regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; } else { regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; } regex = caseSensitive ? new RegExp(regex) : new RegExp(regex, "i"); return this.optional(element) || regex.test(value); }, "Please specify a valid state"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/strippedminlength.js ================================================ // TODO check if value starts with <, otherwise don't try stripping anything $.validator.addMethod("strippedminlength", function(value, element, param) { return $(value).text().length >= param; }, $.validator.format("Please enter at least {0} characters")); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/time.js ================================================ $.validator.addMethod("time", function(value, element) { return this.optional(element) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(value); }, "Please enter a valid time, between 00:00 and 23:59"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/time12h.js ================================================ $.validator.addMethod("time12h", function(value, element) { return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(value); }, "Please enter a valid time in 12-hour am/pm format"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/url2.js ================================================ // same as url, but TLD is optional $.validator.addMethod("url2", function(value, element) { return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); }, $.validator.messages.url); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/vinUS.js ================================================ /** * Return true, if the value is a valid vehicle identification number (VIN). * * Works with all kind of text inputs. * * @example * @desc Declares a required input element whose value must be a valid vehicle identification number. * * @name $.validator.methods.vinUS * @type Boolean * @cat Plugins/Validate/Methods */ $.validator.addMethod("vinUS", function(v) { if (v.length !== 17) { return false; } var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ], VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ], FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ], rs = 0, i, n, d, f, cd, cdv; for (i = 0; i < 17; i++) { f = FL[i]; d = v.slice(i, i + 1); if (i === 8) { cdv = d; } if (!isNaN(d)) { d *= f; } else { for (n = 0; n < LL.length; n++) { if (d.toUpperCase() === LL[n]) { d = VL[n]; d *= f; if (isNaN(cdv) && n === 8) { cdv = LL[n]; } break; } } } rs += d; } cd = rs % 11; if (cd === 10) { cd = "X"; } if (cd === cdv) { return true; } return false; }, "The specified vehicle identification number (VIN) is invalid."); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/zipcodeUS.js ================================================ $.validator.addMethod("zipcodeUS", function(value, element) { return this.optional(element) || /^\d{5}(-\d{4})?$/.test(value); }, "The specified US ZIP Code is invalid"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/additional/ziprange.js ================================================ $.validator.addMethod("ziprange", function(value, element) { return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value); }, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx"); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/ajax.js ================================================ // ajax mode: abort // usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); // if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() var pendingRequests = {}, ajax; // Use a prefilter if available (1.5+) if ( $.ajaxPrefilter ) { $.ajaxPrefilter(function( settings, _, xhr ) { var port = settings.port; if ( settings.mode === "abort" ) { if ( pendingRequests[port] ) { pendingRequests[port].abort(); } pendingRequests[port] = xhr; } }); } else { // Proxy ajax ajax = $.ajax; $.ajax = function( settings ) { var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, port = ( "port" in settings ? settings : $.ajaxSettings ).port; if ( mode === "abort" ) { if ( pendingRequests[port] ) { pendingRequests[port].abort(); } pendingRequests[port] = ajax.apply(this, arguments); return pendingRequests[port]; } return ajax.apply(this, arguments); }; } ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/core.js ================================================ $.extend($.fn, { // http://jqueryvalidation.org/validate/ validate: function( options ) { // if nothing is selected, return nothing; can't chain anyway if ( !this.length ) { if ( options && options.debug && window.console ) { console.warn( "Nothing selected, can't validate, returning nothing." ); } return; } // check if a validator for this form was already created var validator = $.data( this[ 0 ], "validator" ); if ( validator ) { return validator; } // Add novalidate tag if HTML5. this.attr( "novalidate", "novalidate" ); validator = new $.validator( options, this[ 0 ] ); $.data( this[ 0 ], "validator", validator ); if ( validator.settings.onsubmit ) { this.on( "click.validate", ":submit", function( event ) { if ( validator.settings.submitHandler ) { validator.submitButton = event.target; } // allow suppressing validation by adding a cancel class to the submit button if ( $( this ).hasClass( "cancel" ) ) { validator.cancelSubmit = true; } // allow suppressing validation by adding the html5 formnovalidate attribute to the submit button if ( $( this ).attr( "formnovalidate" ) !== undefined ) { validator.cancelSubmit = true; } }); // validate the form on submit this.on( "submit.validate", function( event ) { if ( validator.settings.debug ) { // prevent form submit to be able to see console output event.preventDefault(); } function handle() { var hidden, result; if ( validator.settings.submitHandler ) { if ( validator.submitButton ) { // insert a hidden input as a replacement for the missing submit button hidden = $( "" ) .attr( "name", validator.submitButton.name ) .val( $( validator.submitButton ).val() ) .appendTo( validator.currentForm ); } result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); if ( validator.submitButton ) { // and clean up afterwards; thanks to no-block-scope, hidden can be referenced hidden.remove(); } if ( result !== undefined ) { return result; } return false; } return true; } // prevent submit for invalid forms or custom submit handlers if ( validator.cancelSubmit ) { validator.cancelSubmit = false; return handle(); } if ( validator.form() ) { if ( validator.pendingRequest ) { validator.formSubmitted = true; return false; } return handle(); } else { validator.focusInvalid(); return false; } }); } return validator; }, // http://jqueryvalidation.org/valid/ valid: function() { var valid, validator, errorList; if ( $( this[ 0 ] ).is( "form" ) ) { valid = this.validate().form(); } else { errorList = []; valid = true; validator = $( this[ 0 ].form ).validate(); this.each( function() { valid = validator.element( this ) && valid; errorList = errorList.concat( validator.errorList ); }); validator.errorList = errorList; } return valid; }, // http://jqueryvalidation.org/rules/ rules: function( command, argument ) { var element = this[ 0 ], settings, staticRules, existingRules, data, param, filtered; if ( command ) { settings = $.data( element.form, "validator" ).settings; staticRules = settings.rules; existingRules = $.validator.staticRules( element ); switch ( command ) { case "add": $.extend( existingRules, $.validator.normalizeRule( argument ) ); // remove messages from rules, but allow them to be set separately delete existingRules.messages; staticRules[ element.name ] = existingRules; if ( argument.messages ) { settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); } break; case "remove": if ( !argument ) { delete staticRules[ element.name ]; return existingRules; } filtered = {}; $.each( argument.split( /\s/ ), function( index, method ) { filtered[ method ] = existingRules[ method ]; delete existingRules[ method ]; if ( method === "required" ) { $( element ).removeAttr( "aria-required" ); } }); return filtered; } } data = $.validator.normalizeRules( $.extend( {}, $.validator.classRules( element ), $.validator.attributeRules( element ), $.validator.dataRules( element ), $.validator.staticRules( element ) ), element ); // make sure required is at front if ( data.required ) { param = data.required; delete data.required; data = $.extend( { required: param }, data ); $( element ).attr( "aria-required", "true" ); } // make sure remote is at back if ( data.remote ) { param = data.remote; delete data.remote; data = $.extend( data, { remote: param }); } return data; } }); // Custom selectors $.extend( $.expr[ ":" ], { // http://jqueryvalidation.org/blank-selector/ blank: function( a ) { return !$.trim( "" + $( a ).val() ); }, // http://jqueryvalidation.org/filled-selector/ filled: function( a ) { return !!$.trim( "" + $( a ).val() ); }, // http://jqueryvalidation.org/unchecked-selector/ unchecked: function( a ) { return !$( a ).prop( "checked" ); } }); // constructor for validator $.validator = function( options, form ) { this.settings = $.extend( true, {}, $.validator.defaults, options ); this.currentForm = form; this.init(); }; // http://jqueryvalidation.org/jQuery.validator.format/ $.validator.format = function( source, params ) { if ( arguments.length === 1 ) { return function() { var args = $.makeArray( arguments ); args.unshift( source ); return $.validator.format.apply( this, args ); }; } if ( arguments.length > 2 && params.constructor !== Array ) { params = $.makeArray( arguments ).slice( 1 ); } if ( params.constructor !== Array ) { params = [ params ]; } $.each( params, function( i, n ) { source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { return n; }); }); return source; }; $.extend( $.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusCleanup: false, focusInvalid: true, errorContainer: $( [] ), errorLabelContainer: $( [] ), onsubmit: true, ignore: ":hidden", ignoreTitle: false, onfocusin: function( element ) { this.lastActive = element; // Hide error label and remove error class on focus if enabled if ( this.settings.focusCleanup ) { if ( this.settings.unhighlight ) { this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); } this.hideThese( this.errorsFor( element ) ); } }, onfocusout: function( element ) { if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) { this.element( element ); } }, onkeyup: function( element, event ) { // Avoid revalidate the field when pressing one of the following keys // Shift => 16 // Ctrl => 17 // Alt => 18 // Caps lock => 20 // End => 35 // Home => 36 // Left arrow => 37 // Up arrow => 38 // Right arrow => 39 // Down arrow => 40 // Insert => 45 // Num lock => 144 // AltGr key => 225 var excludedKeys = [ 16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225 ]; if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { return; } else if ( element.name in this.submitted || element === this.lastElement ) { this.element( element ); } }, onclick: function( element ) { // click on selects, radiobuttons and checkboxes if ( element.name in this.submitted ) { this.element( element ); // or option elements, check parent select in that case } else if ( element.parentNode.name in this.submitted ) { this.element( element.parentNode ); } }, highlight: function( element, errorClass, validClass ) { if ( element.type === "radio" ) { this.findByName( element.name ).addClass( errorClass ).removeClass( validClass ); } else { $( element ).addClass( errorClass ).removeClass( validClass ); } }, unhighlight: function( element, errorClass, validClass ) { if ( element.type === "radio" ) { this.findByName( element.name ).removeClass( errorClass ).addClass( validClass ); } else { $( element ).removeClass( errorClass ).addClass( validClass ); } } }, // http://jqueryvalidation.org/jQuery.validator.setDefaults/ setDefaults: function( settings ) { $.extend( $.validator.defaults, settings ); }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date ( ISO ).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", maxlength: $.validator.format( "Please enter no more than {0} characters." ), minlength: $.validator.format( "Please enter at least {0} characters." ), rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ), range: $.validator.format( "Please enter a value between {0} and {1}." ), max: $.validator.format( "Please enter a value less than or equal to {0}." ), min: $.validator.format( "Please enter a value greater than or equal to {0}." ) }, autoCreateRanges: false, prototype: { init: function() { this.labelContainer = $( this.settings.errorLabelContainer ); this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm ); this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer ); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var groups = ( this.groups = {} ), rules; $.each( this.settings.groups, function( key, value ) { if ( typeof value === "string" ) { value = value.split( /\s/ ); } $.each( value, function( index, name ) { groups[ name ] = key; }); }); rules = this.settings.rules; $.each( rules, function( key, value ) { rules[ key ] = $.validator.normalizeRule( value ); }); function delegate( event ) { var validator = $.data( this.form, "validator" ), eventType = "on" + event.type.replace( /^validate/, "" ), settings = validator.settings; if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) { settings[ eventType ].call( validator, this, event ); } } $( this.currentForm ) .on( "focusin.validate focusout.validate keyup.validate", ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + "[type='radio'], [type='checkbox']", delegate) // Support: Chrome, oldIE // "select" is provided as event.target when clicking a option .on("click.validate", "select, option, [type='radio'], [type='checkbox']", delegate); if ( this.settings.invalidHandler ) { $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler ); } // Add aria-required to any Static/Data/Class required fields before first validation // Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html $( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" ); }, // http://jqueryvalidation.org/Validator.form/ form: function() { this.checkForm(); $.extend( this.submitted, this.errorMap ); this.invalid = $.extend({}, this.errorMap ); if ( !this.valid() ) { $( this.currentForm ).triggerHandler( "invalid-form", [ this ]); } this.showErrors(); return this.valid(); }, checkForm: function() { this.prepareForm(); for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) { this.check( elements[ i ] ); } return this.valid(); }, // http://jqueryvalidation.org/Validator.element/ element: function( element ) { var cleanElement = this.clean( element ), checkElement = this.validationTargetFor( cleanElement ), result = true; this.lastElement = checkElement; if ( checkElement === undefined ) { delete this.invalid[ cleanElement.name ]; } else { this.prepareElement( checkElement ); this.currentElements = $( checkElement ); result = this.check( checkElement ) !== false; if ( result ) { delete this.invalid[ checkElement.name ]; } else { this.invalid[ checkElement.name ] = true; } } // Add aria-invalid status for screen readers $( element ).attr( "aria-invalid", !result ); if ( !this.numberOfInvalids() ) { // Hide error containers on last error this.toHide = this.toHide.add( this.containers ); } this.showErrors(); return result; }, // http://jqueryvalidation.org/Validator.showErrors/ showErrors: function( errors ) { if ( errors ) { // add items to error list and map $.extend( this.errorMap, errors ); this.errorList = []; for ( var name in errors ) { this.errorList.push({ message: errors[ name ], element: this.findByName( name )[ 0 ] }); } // remove items from success list this.successList = $.grep( this.successList, function( element ) { return !( element.name in errors ); }); } if ( this.settings.showErrors ) { this.settings.showErrors.call( this, this.errorMap, this.errorList ); } else { this.defaultShowErrors(); } }, // http://jqueryvalidation.org/Validator.resetForm/ resetForm: function() { if ( $.fn.resetForm ) { $( this.currentForm ).resetForm(); } this.submitted = {}; this.lastElement = null; this.prepareForm(); this.hideErrors(); var i, elements = this.elements() .removeData( "previousValue" ) .removeAttr( "aria-invalid" ); if ( this.settings.unhighlight ) { for ( i = 0; elements[ i ]; i++ ) { this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, "" ); } } else { elements.removeClass( this.settings.errorClass ); } }, numberOfInvalids: function() { return this.objectLength( this.invalid ); }, objectLength: function( obj ) { /* jshint unused: false */ var count = 0, i; for ( i in obj ) { count++; } return count; }, hideErrors: function() { this.hideThese( this.toHide ); }, hideThese: function( errors ) { errors.not( this.containers ).text( "" ); this.addWrapper( errors ).hide(); }, valid: function() { return this.size() === 0; }, size: function() { return this.errorList.length; }, focusInvalid: function() { if ( this.settings.focusInvalid ) { try { $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || []) .filter( ":visible" ) .focus() // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find .trigger( "focusin" ); } catch ( e ) { // ignore IE throwing errors when focusing hidden elements } } }, findLastActive: function() { var lastActive = this.lastActive; return lastActive && $.grep( this.errorList, function( n ) { return n.element.name === lastActive.name; }).length === 1 && lastActive; }, elements: function() { var validator = this, rulesCache = {}; // select all valid inputs inside the form (no submit or reset buttons) return $( this.currentForm ) .find( "input, select, textarea" ) .not( ":submit, :reset, :image, :disabled" ) .not( this.settings.ignore ) .filter( function() { if ( !this.name && validator.settings.debug && window.console ) { console.error( "%o has no name assigned", this ); } // select only the first element for each name, and only those with rules specified if ( this.name in rulesCache || !validator.objectLength( $( this ).rules() ) ) { return false; } rulesCache[ this.name ] = true; return true; }); }, clean: function( selector ) { return $( selector )[ 0 ]; }, errors: function() { var errorClass = this.settings.errorClass.split( " " ).join( "." ); return $( this.settings.errorElement + "." + errorClass, this.errorContext ); }, reset: function() { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = $( [] ); this.toHide = $( [] ); this.currentElements = $( [] ); }, prepareForm: function() { this.reset(); this.toHide = this.errors().add( this.containers ); }, prepareElement: function( element ) { this.reset(); this.toHide = this.errorsFor( element ); }, elementValue: function( element ) { var val, $element = $( element ), type = element.type; if ( type === "radio" || type === "checkbox" ) { return this.findByName( element.name ).filter(":checked").val(); } else if ( type === "number" && typeof element.validity !== "undefined" ) { return element.validity.badInput ? false : $element.val(); } val = $element.val(); if ( typeof val === "string" ) { return val.replace(/\r/g, "" ); } return val; }, check: function( element ) { element = this.validationTargetFor( this.clean( element ) ); var rules = $( element ).rules(), rulesCount = $.map( rules, function( n, i ) { return i; }).length, dependencyMismatch = false, val = this.elementValue( element ), result, method, rule; for ( method in rules ) { rule = { method: method, parameters: rules[ method ] }; try { result = $.validator.methods[ method ].call( this, val, element, rule.parameters ); // if a method indicates that the field is optional and therefore valid, // don't mark it as valid when there are no other rules if ( result === "dependency-mismatch" && rulesCount === 1 ) { dependencyMismatch = true; continue; } dependencyMismatch = false; if ( result === "pending" ) { this.toHide = this.toHide.not( this.errorsFor( element ) ); return; } if ( !result ) { this.formatAndAdd( element, rule ); return false; } } catch ( e ) { if ( this.settings.debug && window.console ) { console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e ); } if ( e instanceof TypeError ) { e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; } throw e; } } if ( dependencyMismatch ) { return; } if ( this.objectLength( rules ) ) { this.successList.push( element ); } return true; }, // return the custom message for the given element and validation method // specified in the element's HTML5 data attribute // return the generic message if present and no method specific message is present customDataMessage: function( element, method ) { return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" ); }, // return the custom message for the given element name and validation method customMessage: function( name, method ) { var m = this.settings.messages[ name ]; return m && ( m.constructor === String ? m : m[ method ]); }, // return the first defined argument, allowing empty strings findDefined: function() { for ( var i = 0; i < arguments.length; i++) { if ( arguments[ i ] !== undefined ) { return arguments[ i ]; } } return undefined; }, defaultMessage: function( element, method ) { return this.findDefined( this.customMessage( element.name, method ), this.customDataMessage( element, method ), // title is never undefined, so handle empty string as undefined !this.settings.ignoreTitle && element.title || undefined, $.validator.messages[ method ], "Warning: No message defined for " + element.name + "" ); }, formatAndAdd: function( element, rule ) { var message = this.defaultMessage( element, rule.method ), theregex = /\$?\{(\d+)\}/g; if ( typeof message === "function" ) { message = message.call( this, rule.parameters, element ); } else if ( theregex.test( message ) ) { message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters ); } this.errorList.push({ message: message, element: element, method: rule.method }); this.errorMap[ element.name ] = message; this.submitted[ element.name ] = message; }, addWrapper: function( toToggle ) { if ( this.settings.wrapper ) { toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); } return toToggle; }, defaultShowErrors: function() { var i, elements, error; for ( i = 0; this.errorList[ i ]; i++ ) { error = this.errorList[ i ]; if ( this.settings.highlight ) { this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); } this.showLabel( error.element, error.message ); } if ( this.errorList.length ) { this.toShow = this.toShow.add( this.containers ); } if ( this.settings.success ) { for ( i = 0; this.successList[ i ]; i++ ) { this.showLabel( this.successList[ i ] ); } } if ( this.settings.unhighlight ) { for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) { this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass ); } } this.toHide = this.toHide.not( this.toShow ); this.hideErrors(); this.addWrapper( this.toShow ).show(); }, validElements: function() { return this.currentElements.not( this.invalidElements() ); }, invalidElements: function() { return $( this.errorList ).map(function() { return this.element; }); }, showLabel: function( element, message ) { var place, group, errorID, error = this.errorsFor( element ), elementID = this.idOrName( element ), describedBy = $( element ).attr( "aria-describedby" ); if ( error.length ) { // refresh error/success class error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); // replace message on existing label error.html( message ); } else { // create error element error = $( "<" + this.settings.errorElement + ">" ) .attr( "id", elementID + "-error" ) .addClass( this.settings.errorClass ) .html( message || "" ); // Maintain reference to the element to be placed into the DOM place = error; if ( this.settings.wrapper ) { // make sure the element is visible, even in IE // actually showing the wrapped element is handled elsewhere place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent(); } if ( this.labelContainer.length ) { this.labelContainer.append( place ); } else if ( this.settings.errorPlacement ) { this.settings.errorPlacement( place, $( element ) ); } else { place.insertAfter( element ); } // Link error back to the element if ( error.is( "label" ) ) { // If the error is a label, then associate using 'for' error.attr( "for", elementID ); } else if ( error.parents( "label[for='" + elementID + "']" ).length === 0 ) { // If the element is not a child of an associated label, then it's necessary // to explicitly apply aria-describedby errorID = error.attr( "id" ).replace( /(:|\.|\[|\]|\$)/g, "\\$1"); // Respect existing non-error aria-describedby if ( !describedBy ) { describedBy = errorID; } else if ( !describedBy.match( new RegExp( "\\b" + errorID + "\\b" ) ) ) { // Add to end of list if not already present describedBy += " " + errorID; } $( element ).attr( "aria-describedby", describedBy ); // If this element is grouped, then assign to all elements in the same group group = this.groups[ element.name ]; if ( group ) { $.each( this.groups, function( name, testgroup ) { if ( testgroup === group ) { $( "[name='" + name + "']", this.currentForm ) .attr( "aria-describedby", error.attr( "id" ) ); } }); } } } if ( !message && this.settings.success ) { error.text( "" ); if ( typeof this.settings.success === "string" ) { error.addClass( this.settings.success ); } else { this.settings.success( error, element ); } } this.toShow = this.toShow.add( error ); }, errorsFor: function( element ) { var name = this.idOrName( element ), describer = $( element ).attr( "aria-describedby" ), selector = "label[for='" + name + "'], label[for='" + name + "'] *"; // aria-describedby should directly reference the error element if ( describer ) { selector = selector + ", #" + describer.replace( /\s+/g, ", #" ); } return this .errors() .filter( selector ); }, idOrName: function( element ) { return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name ); }, validationTargetFor: function( element ) { // If radio/checkbox, validate first element in group instead if ( this.checkable( element ) ) { element = this.findByName( element.name ); } // Always apply ignore filter return $( element ).not( this.settings.ignore )[ 0 ]; }, checkable: function( element ) { return ( /radio|checkbox/i ).test( element.type ); }, findByName: function( name ) { return $( this.currentForm ).find( "[name='" + name + "']" ); }, getLength: function( value, element ) { switch ( element.nodeName.toLowerCase() ) { case "select": return $( "option:selected", element ).length; case "input": if ( this.checkable( element ) ) { return this.findByName( element.name ).filter( ":checked" ).length; } } return value.length; }, depend: function( param, element ) { return this.dependTypes[typeof param] ? this.dependTypes[typeof param]( param, element ) : true; }, dependTypes: { "boolean": function( param ) { return param; }, "string": function( param, element ) { return !!$( param, element.form ).length; }, "function": function( param, element ) { return param( element ); } }, optional: function( element ) { var val = this.elementValue( element ); return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch"; }, startRequest: function( element ) { if ( !this.pending[ element.name ] ) { this.pendingRequest++; this.pending[ element.name ] = true; } }, stopRequest: function( element, valid ) { this.pendingRequest--; // sometimes synchronization fails, make sure pendingRequest is never < 0 if ( this.pendingRequest < 0 ) { this.pendingRequest = 0; } delete this.pending[ element.name ]; if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) { $( this.currentForm ).submit(); this.formSubmitted = false; } else if (!valid && this.pendingRequest === 0 && this.formSubmitted ) { $( this.currentForm ).triggerHandler( "invalid-form", [ this ]); this.formSubmitted = false; } }, previousValue: function( element ) { return $.data( element, "previousValue" ) || $.data( element, "previousValue", { old: null, valid: true, message: this.defaultMessage( element, "remote" ) }); }, // cleans up all forms and elements, removes validator-specific events destroy: function() { this.resetForm(); $( this.currentForm ) .off( ".validate" ) .removeData( "validator" ); } }, classRuleSettings: { required: { required: true }, email: { email: true }, url: { url: true }, date: { date: true }, dateISO: { dateISO: true }, number: { number: true }, digits: { digits: true }, creditcard: { creditcard: true } }, addClassRules: function( className, rules ) { if ( className.constructor === String ) { this.classRuleSettings[ className ] = rules; } else { $.extend( this.classRuleSettings, className ); } }, classRules: function( element ) { var rules = {}, classes = $( element ).attr( "class" ); if ( classes ) { $.each( classes.split( " " ), function() { if ( this in $.validator.classRuleSettings ) { $.extend( rules, $.validator.classRuleSettings[ this ]); } }); } return rules; }, normalizeAttributeRule: function( rules, type, method, value ) { // convert the value to a number for number inputs, and for text for backwards compability // allows type="date" and others to be compared as strings if ( /min|max/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) { value = Number( value ); // Support Opera Mini, which returns NaN for undefined minlength if ( isNaN( value ) ) { value = undefined; } } if ( value || value === 0 ) { rules[ method ] = value; } else if ( type === method && type !== "range" ) { // exception: the jquery validate 'range' method // does not test for the html5 'range' type rules[ method ] = true; } }, attributeRules: function( element ) { var rules = {}, $element = $( element ), type = element.getAttribute( "type" ), method, value; for ( method in $.validator.methods ) { // support for in both html5 and older browsers if ( method === "required" ) { value = element.getAttribute( method ); // Some browsers return an empty string for the required attribute // and non-HTML5 browsers might have required="" markup if ( value === "" ) { value = true; } // force non-HTML5 browsers to return bool value = !!value; } else { value = $element.attr( method ); } this.normalizeAttributeRule( rules, type, method, value ); } // maxlength may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) { delete rules.maxlength; } return rules; }, dataRules: function( element ) { var rules = {}, $element = $( element ), type = element.getAttribute( "type" ), method, value; for ( method in $.validator.methods ) { value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ); this.normalizeAttributeRule( rules, type, method, value ); } return rules; }, staticRules: function( element ) { var rules = {}, validator = $.data( element.form, "validator" ); if ( validator.settings.rules ) { rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {}; } return rules; }, normalizeRules: function( rules, element ) { // handle dependency check $.each( rules, function( prop, val ) { // ignore rule when param is explicitly false, eg. required:false if ( val === false ) { delete rules[ prop ]; return; } if ( val.param || val.depends ) { var keepRule = true; switch ( typeof val.depends ) { case "string": keepRule = !!$( val.depends, element.form ).length; break; case "function": keepRule = val.depends.call( element, element ); break; } if ( keepRule ) { rules[ prop ] = val.param !== undefined ? val.param : true; } else { delete rules[ prop ]; } } }); // evaluate parameters $.each( rules, function( rule, parameter ) { rules[ rule ] = $.isFunction( parameter ) ? parameter( element ) : parameter; }); // clean number parameters $.each([ "minlength", "maxlength" ], function() { if ( rules[ this ] ) { rules[ this ] = Number( rules[ this ] ); } }); $.each([ "rangelength", "range" ], function() { var parts; if ( rules[ this ] ) { if ( $.isArray( rules[ this ] ) ) { rules[ this ] = [ Number( rules[ this ][ 0 ]), Number( rules[ this ][ 1 ] ) ]; } else if ( typeof rules[ this ] === "string" ) { parts = rules[ this ].replace(/[\[\]]/g, "" ).split( /[\s,]+/ ); rules[ this ] = [ Number( parts[ 0 ]), Number( parts[ 1 ] ) ]; } } }); if ( $.validator.autoCreateRanges ) { // auto-create ranges if ( rules.min != null && rules.max != null ) { rules.range = [ rules.min, rules.max ]; delete rules.min; delete rules.max; } if ( rules.minlength != null && rules.maxlength != null ) { rules.rangelength = [ rules.minlength, rules.maxlength ]; delete rules.minlength; delete rules.maxlength; } } return rules; }, // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} normalizeRule: function( data ) { if ( typeof data === "string" ) { var transformed = {}; $.each( data.split( /\s/ ), function() { transformed[ this ] = true; }); data = transformed; } return data; }, // http://jqueryvalidation.org/jQuery.validator.addMethod/ addMethod: function( name, method, message ) { $.validator.methods[ name ] = method; $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ]; if ( method.length < 3 ) { $.validator.addClassRules( name, $.validator.normalizeRule( name ) ); } }, methods: { // http://jqueryvalidation.org/required-method/ required: function( value, element, param ) { // check if dependency is met if ( !this.depend( param, element ) ) { return "dependency-mismatch"; } if ( element.nodeName.toLowerCase() === "select" ) { // could be an array for select-multiple or a string, both are fine this way var val = $( element ).val(); return val && val.length > 0; } if ( this.checkable( element ) ) { return this.getLength( value, element ) > 0; } return value.length > 0; }, // http://jqueryvalidation.org/email-method/ email: function( value, element ) { // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address // Retrieved 2014-01-14 // If you have a problem with this implementation, report a bug against the above spec // Or use custom methods to implement your own email validation return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value ); }, // http://jqueryvalidation.org/url-method/ url: function( value, element ) { // Copyright (c) 2010-2013 Diego Perini, MIT licensed // https://gist.github.com/dperini/729294 // see also https://mathiasbynens.be/demo/url-regex // modified to allow protocol-relative URLs return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value ); }, // http://jqueryvalidation.org/date-method/ date: function( value, element ) { return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); }, // http://jqueryvalidation.org/dateISO-method/ dateISO: function( value, element ) { return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); }, // http://jqueryvalidation.org/number-method/ number: function( value, element ) { return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value ); }, // http://jqueryvalidation.org/digits-method/ digits: function( value, element ) { return this.optional( element ) || /^\d+$/.test( value ); }, // http://jqueryvalidation.org/creditcard-method/ // based on http://en.wikipedia.org/wiki/Luhn_algorithm creditcard: function( value, element ) { if ( this.optional( element ) ) { return "dependency-mismatch"; } // accept only spaces, digits and dashes if ( /[^0-9 \-]+/.test( value ) ) { return false; } var nCheck = 0, nDigit = 0, bEven = false, n, cDigit; value = value.replace( /\D/g, "" ); // Basing min and max length on // http://developer.ean.com/general_info/Valid_Credit_Card_Types if ( value.length < 13 || value.length > 19 ) { return false; } for ( n = value.length - 1; n >= 0; n--) { cDigit = value.charAt( n ); nDigit = parseInt( cDigit, 10 ); if ( bEven ) { if ( ( nDigit *= 2 ) > 9 ) { nDigit -= 9; } } nCheck += nDigit; bEven = !bEven; } return ( nCheck % 10 ) === 0; }, // http://jqueryvalidation.org/minlength-method/ minlength: function( value, element, param ) { var length = $.isArray( value ) ? value.length : this.getLength( value, element ); return this.optional( element ) || length >= param; }, // http://jqueryvalidation.org/maxlength-method/ maxlength: function( value, element, param ) { var length = $.isArray( value ) ? value.length : this.getLength( value, element ); return this.optional( element ) || length <= param; }, // http://jqueryvalidation.org/rangelength-method/ rangelength: function( value, element, param ) { var length = $.isArray( value ) ? value.length : this.getLength( value, element ); return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); }, // http://jqueryvalidation.org/min-method/ min: function( value, element, param ) { return this.optional( element ) || value >= param; }, // http://jqueryvalidation.org/max-method/ max: function( value, element, param ) { return this.optional( element ) || value <= param; }, // http://jqueryvalidation.org/range-method/ range: function( value, element, param ) { return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); }, // http://jqueryvalidation.org/equalTo-method/ equalTo: function( value, element, param ) { // bind to the blur event of the target in order to revalidate whenever the target field is updated // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead var target = $( param ); if ( this.settings.onfocusout ) { target.off( ".validate-equalTo" ).on( "blur.validate-equalTo", function() { $( element ).valid(); }); } return value === target.val(); }, // http://jqueryvalidation.org/remote-method/ remote: function( value, element, param ) { if ( this.optional( element ) ) { return "dependency-mismatch"; } var previous = this.previousValue( element ), validator, data; if (!this.settings.messages[ element.name ] ) { this.settings.messages[ element.name ] = {}; } previous.originalMessage = this.settings.messages[ element.name ].remote; this.settings.messages[ element.name ].remote = previous.message; param = typeof param === "string" && { url: param } || param; if ( previous.old === value ) { return previous.valid; } previous.old = value; validator = this; this.startRequest( element ); data = {}; data[ element.name ] = value; $.ajax( $.extend( true, { mode: "abort", port: "validate" + element.name, dataType: "json", data: data, context: validator.currentForm, success: function( response ) { var valid = response === true || response === "true", errors, message, submitted; validator.settings.messages[ element.name ].remote = previous.originalMessage; if ( valid ) { submitted = validator.formSubmitted; validator.prepareElement( element ); validator.formSubmitted = submitted; validator.successList.push( element ); delete validator.invalid[ element.name ]; validator.showErrors(); } else { errors = {}; message = response || validator.defaultMessage( element, "remote" ); errors[ element.name ] = previous.message = $.isFunction( message ) ? message( value ) : message; validator.invalid[ element.name ] = true; validator.showErrors( errors ); } previous.valid = valid; validator.stopRequest( element, valid ); } }, param ) ); return "pending"; } } }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_ar.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: AR (Arabic; العربية) */ $.extend($.validator.messages, { required: "هذا الحقل إلزامي", remote: "يرجى تصحيح هذا الحقل للمتابعة", email: "رجاء إدخال عنوان بريد إلكتروني صحيح", url: "رجاء إدخال عنوان موقع إلكتروني صحيح", date: "رجاء إدخال تاريخ صحيح", dateISO: "رجاء إدخال تاريخ صحيح (ISO)", number: "رجاء إدخال عدد بطريقة صحيحة", digits: "رجاء إدخال أرقام فقط", creditcard: "رجاء إدخال رقم بطاقة ائتمان صحيح", equalTo: "رجاء إدخال نفس القيمة", extension: "رجاء إدخال ملف بامتداد موافق عليه", maxlength: $.validator.format("الحد الأقصى لعدد الحروف هو {0}"), minlength: $.validator.format("الحد الأدنى لعدد الحروف هو {0}"), rangelength: $.validator.format("عدد الحروف يجب أن يكون بين {0} و {1}"), range: $.validator.format("رجاء إدخال عدد قيمته بين {0} و {1}"), max: $.validator.format("رجاء إدخال عدد أقل من أو يساوي (0}"), min: $.validator.format("رجاء إدخال عدد أكبر من أو يساوي (0}") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_bg.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: BG (Bulgarian; български език) */ $.extend($.validator.messages, { required: "Полето е задължително.", remote: "Моля, въведете правилната стойност.", email: "Моля, въведете валиден email.", url: "Моля, въведете валидно URL.", date: "Моля, въведете валидна дата.", dateISO: "Моля, въведете валидна дата (ISO).", number: "Моля, въведете валиден номер.", digits: "Моля, въведете само цифри.", creditcard: "Моля, въведете валиден номер на кредитна карта.", equalTo: "Моля, въведете същата стойност отново.", extension: "Моля, въведете стойност с валидно разширение.", maxlength: $.validator.format("Моля, въведете повече от {0} символа."), minlength: $.validator.format("Моля, въведете поне {0} символа."), rangelength: $.validator.format("Моля, въведете стойност с дължина между {0} и {1} символа."), range: $.validator.format("Моля, въведете стойност между {0} и {1}."), max: $.validator.format("Моля, въведете стойност по-малка или равна на {0}."), min: $.validator.format("Моля, въведете стойност по-голяма или равна на {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_bn_BD.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: bn_BD (Bengali, Bangladesh) */ $.extend($.validator.messages, { required: "এই তথ্যটি আবশ্যক।", remote: "এই তথ্যটি ঠিক করুন।", email: "অনুগ্রহ করে একটি সঠিক মেইল ঠিকানা লিখুন।", url: "অনুগ্রহ করে একটি সঠিক লিঙ্ক দিন।", date: "তারিখ সঠিক নয়।", dateISO: "অনুগ্রহ করে একটি সঠিক (ISO) তারিখ লিখুন।", number: "অনুগ্রহ করে একটি সঠিক নম্বর লিখুন।", digits: "এখানে শুধু সংখ্যা ব্যবহার করা যাবে।", creditcard: "অনুগ্রহ করে একটি ক্রেডিট কার্ডের সঠিক নম্বর লিখুন।", equalTo: "একই মান আবার লিখুন।", extension: "সঠিক ধরনের ফাইল আপলোড করুন।", maxlength: $.validator.format("{0}টির বেশি অক্ষর লেখা যাবে না।"), minlength: $.validator.format("{0}টির কম অক্ষর লেখা যাবে না।"), rangelength: $.validator.format("{0} থেকে {1} টি অক্ষর সম্বলিত মান লিখুন।"), range: $.validator.format("{0} থেকে {1} এর মধ্যে একটি মান ব্যবহার করুন।"), max: $.validator.format("অনুগ্রহ করে {0} বা তার চাইতে কম মান ব্যবহার করুন।"), min: $.validator.format("অনুগ্রহ করে {0} বা তার চাইতে বেশি মান ব্যবহার করুন।") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_ca.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: CA (Catalan; català) */ $.extend($.validator.messages, { required: "Aquest camp és obligatori.", remote: "Si us plau, omple aquest camp.", email: "Si us plau, escriu una adreça de correu-e vàlida", url: "Si us plau, escriu una URL vàlida.", date: "Si us plau, escriu una data vàlida.", dateISO: "Si us plau, escriu una data (ISO) vàlida.", number: "Si us plau, escriu un número enter vàlid.", digits: "Si us plau, escriu només dígits.", creditcard: "Si us plau, escriu un número de tarjeta vàlid.", equalTo: "Si us plau, escriu el mateix valor de nou.", extension: "Si us plau, escriu un valor amb una extensió acceptada.", maxlength: $.validator.format("Si us plau, no escriguis més de {0} caracters."), minlength: $.validator.format("Si us plau, no escriguis menys de {0} caracters."), rangelength: $.validator.format("Si us plau, escriu un valor entre {0} i {1} caracters."), range: $.validator.format("Si us plau, escriu un valor entre {0} i {1}."), max: $.validator.format("Si us plau, escriu un valor menor o igual a {0}."), min: $.validator.format("Si us plau, escriu un valor major o igual a {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_cs.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: CS (Czech; čeština, český jazyk) */ $.extend($.validator.messages, { required: "Tento údaj je povinný.", remote: "Prosím, opravte tento údaj.", email: "Prosím, zadejte platný e-mail.", url: "Prosím, zadejte platné URL.", date: "Prosím, zadejte platné datum.", dateISO: "Prosím, zadejte platné datum (ISO).", number: "Prosím, zadejte číslo.", digits: "Prosím, zadávejte pouze číslice.", creditcard: "Prosím, zadejte číslo kreditní karty.", equalTo: "Prosím, zadejte znovu stejnou hodnotu.", extension: "Prosím, zadejte soubor se správnou příponou.", maxlength: $.validator.format("Prosím, zadejte nejvíce {0} znaků."), minlength: $.validator.format("Prosím, zadejte nejméně {0} znaků."), rangelength: $.validator.format("Prosím, zadejte od {0} do {1} znaků."), range: $.validator.format("Prosím, zadejte hodnotu od {0} do {1}."), max: $.validator.format("Prosím, zadejte hodnotu menší nebo rovnu {0}."), min: $.validator.format("Prosím, zadejte hodnotu větší nebo rovnu {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_da.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: DA (Danish; dansk) */ $.extend($.validator.messages, { required: "Dette felt er påkrævet.", maxlength: $.validator.format("Indtast højst {0} tegn."), minlength: $.validator.format("Indtast mindst {0} tegn."), rangelength: $.validator.format("Indtast mindst {0} og højst {1} tegn."), email: "Indtast en gyldig email-adresse.", url: "Indtast en gyldig URL.", date: "Indtast en gyldig dato.", number: "Indtast et tal.", digits: "Indtast kun cifre.", equalTo: "Indtast den samme værdi igen.", range: $.validator.format("Angiv en værdi mellem {0} og {1}."), max: $.validator.format("Angiv en værdi der højst er {0}."), min: $.validator.format("Angiv en værdi der mindst er {0}."), creditcard: "Indtast et gyldigt kreditkortnummer." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_de.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: DE (German, Deutsch) */ $.extend($.validator.messages, { required: "Dieses Feld ist ein Pflichtfeld.", maxlength: $.validator.format("Geben Sie bitte maximal {0} Zeichen ein."), minlength: $.validator.format("Geben Sie bitte mindestens {0} Zeichen ein."), rangelength: $.validator.format("Geben Sie bitte mindestens {0} und maximal {1} Zeichen ein."), email: "Geben Sie bitte eine gültige E-Mail Adresse ein.", url: "Geben Sie bitte eine gültige URL ein.", date: "Bitte geben Sie ein gültiges Datum ein.", number: "Geben Sie bitte eine Nummer ein.", digits: "Geben Sie bitte nur Ziffern ein.", equalTo: "Bitte denselben Wert wiederholen.", range: $.validator.format("Geben Sie bitte einen Wert zwischen {0} und {1} ein."), max: $.validator.format("Geben Sie bitte einen Wert kleiner oder gleich {0} ein."), min: $.validator.format("Geben Sie bitte einen Wert größer oder gleich {0} ein."), creditcard: "Geben Sie bitte eine gültige Kreditkarten-Nummer ein." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_el.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: EL (Greek; ελληνικά) */ $.extend($.validator.messages, { required: "Αυτό το πεδίο είναι υποχρεωτικό.", remote: "Παρακαλώ διορθώστε αυτό το πεδίο.", email: "Παρακαλώ εισάγετε μια έγκυρη διεύθυνση email.", url: "Παρακαλώ εισάγετε ένα έγκυρο URL.", date: "Παρακαλώ εισάγετε μια έγκυρη ημερομηνία.", dateISO: "Παρακαλώ εισάγετε μια έγκυρη ημερομηνία (ISO).", number: "Παρακαλώ εισάγετε έναν έγκυρο αριθμό.", digits: "Παρακαλώ εισάγετε μόνο αριθμητικά ψηφία.", creditcard: "Παρακαλώ εισάγετε έναν έγκυρο αριθμό πιστωτικής κάρτας.", equalTo: "Παρακαλώ εισάγετε την ίδια τιμή ξανά.", extension: "Παρακαλώ εισάγετε μια τιμή με έγκυρη επέκταση αρχείου.", maxlength: $.validator.format("Παρακαλώ εισάγετε μέχρι και {0} χαρακτήρες."), minlength: $.validator.format("Παρακαλώ εισάγετε τουλάχιστον {0} χαρακτήρες."), rangelength: $.validator.format("Παρακαλώ εισάγετε μια τιμή με μήκος μεταξύ {0} και {1} χαρακτήρων."), range: $.validator.format("Παρακαλώ εισάγετε μια τιμή μεταξύ {0} και {1}."), max: $.validator.format("Παρακαλώ εισάγετε μια τιμή μικρότερη ή ίση του {0}."), min: $.validator.format("Παρακαλώ εισάγετε μια τιμή μεγαλύτερη ή ίση του {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_es.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: ES (Spanish; Español) */ $.extend($.validator.messages, { required: "Este campo es obligatorio.", remote: "Por favor, rellena este campo.", email: "Por favor, escribe una dirección de correo válida.", url: "Por favor, escribe una URL válida.", date: "Por favor, escribe una fecha válida.", dateISO: "Por favor, escribe una fecha (ISO) válida.", number: "Por favor, escribe un número válido.", digits: "Por favor, escribe sólo dígitos.", creditcard: "Por favor, escribe un número de tarjeta válido.", equalTo: "Por favor, escribe el mismo valor de nuevo.", extension: "Por favor, escribe un valor con una extensión aceptada.", maxlength: $.validator.format("Por favor, no escribas más de {0} caracteres."), minlength: $.validator.format("Por favor, no escribas menos de {0} caracteres."), rangelength: $.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."), range: $.validator.format("Por favor, escribe un valor entre {0} y {1}."), max: $.validator.format("Por favor, escribe un valor menor o igual a {0}."), min: $.validator.format("Por favor, escribe un valor mayor o igual a {0}."), nifES: "Por favor, escribe un NIF válido.", nieES: "Por favor, escribe un NIE válido.", cifES: "Por favor, escribe un CIF válido." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_es_AR.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: ES (Spanish; Español) * Region: AR (Argentina) */ $.extend($.validator.messages, { required: "Este campo es obligatorio.", remote: "Por favor, completá este campo.", email: "Por favor, escribí una dirección de correo válida.", url: "Por favor, escribí una URL válida.", date: "Por favor, escribí una fecha válida.", dateISO: "Por favor, escribí una fecha (ISO) válida.", number: "Por favor, escribí un número entero válido.", digits: "Por favor, escribí sólo dígitos.", creditcard: "Por favor, escribí un número de tarjeta válido.", equalTo: "Por favor, escribí el mismo valor de nuevo.", extension: "Por favor, escribí un valor con una extensión aceptada.", maxlength: $.validator.format("Por favor, no escribas más de {0} caracteres."), minlength: $.validator.format("Por favor, no escribas menos de {0} caracteres."), rangelength: $.validator.format("Por favor, escribí un valor entre {0} y {1} caracteres."), range: $.validator.format("Por favor, escribí un valor entre {0} y {1}."), max: $.validator.format("Por favor, escribí un valor menor o igual a {0}."), min: $.validator.format("Por favor, escribí un valor mayor o igual a {0}."), nifES: "Por favor, escribí un NIF válido.", nieES: "Por favor, escribí un NIE válido.", cifES: "Por favor, escribí un CIF válido." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_es_PE.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: ES (Spanish; Español) * Region: PE (Perú) */ $.extend($.validator.messages, { required: "Este campo es obligatorio.", remote: "Por favor, llene este campo.", email: "Por favor, escriba un correo electrónico válido.", url: "Por favor, escriba una URL válida.", date: "Por favor, escriba una fecha válida.", dateISO: "Por favor, escriba una fecha (ISO) válida.", number: "Por favor, escriba un número válido.", digits: "Por favor, escriba sólo dígitos.", creditcard: "Por favor, escriba un número de tarjeta válido.", equalTo: "Por favor, escriba el mismo valor de nuevo.", extension: "Por favor, escriba un valor con una extensión permitida.", maxlength: $.validator.format("Por favor, no escriba más de {0} caracteres."), minlength: $.validator.format("Por favor, no escriba menos de {0} caracteres."), rangelength: $.validator.format("Por favor, escriba un valor entre {0} y {1} caracteres."), range: $.validator.format("Por favor, escriba un valor entre {0} y {1}."), max: $.validator.format("Por favor, escriba un valor menor o igual a {0}."), min: $.validator.format("Por favor, escriba un valor mayor o igual a {0}."), nifES: "Por favor, escriba un NIF válido.", nieES: "Por favor, escriba un NIE válido.", cifES: "Por favor, escriba un CIF válido." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_et.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: ET (Estonian; eesti, eesti keel) */ $.extend($.validator.messages, { required: "See väli peab olema täidetud.", maxlength: $.validator.format("Palun sisestage vähem kui {0} tähemärki."), minlength: $.validator.format("Palun sisestage vähemalt {0} tähemärki."), rangelength: $.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1} tähemärki."), email: "Palun sisestage korrektne e-maili aadress.", url: "Palun sisestage korrektne URL.", date: "Palun sisestage korrektne kuupäev.", dateISO: "Palun sisestage korrektne kuupäev (YYYY-MM-DD).", number: "Palun sisestage korrektne number.", digits: "Palun sisestage ainult numbreid.", equalTo: "Palun sisestage sama väärtus uuesti.", range: $.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1}."), max: $.validator.format("Palun sisestage väärtus, mis on väiksem või võrdne arvuga {0}."), min: $.validator.format("Palun sisestage väärtus, mis on suurem või võrdne arvuga {0}."), creditcard: "Palun sisestage korrektne krediitkaardi number." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_eu.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: EU (Basque; euskara, euskera) */ $.extend($.validator.messages, { required: "Eremu hau beharrezkoa da.", remote: "Mesedez, bete eremu hau.", email: "Mesedez, idatzi baliozko posta helbide bat.", url: "Mesedez, idatzi baliozko URL bat.", date: "Mesedez, idatzi baliozko data bat.", dateISO: "Mesedez, idatzi baliozko (ISO) data bat.", number: "Mesedez, idatzi baliozko zenbaki oso bat.", digits: "Mesedez, idatzi digituak soilik.", creditcard: "Mesedez, idatzi baliozko txartel zenbaki bat.", equalTo: "Mesedez, idatzi berdina berriro ere.", extension: "Mesedez, idatzi onartutako luzapena duen balio bat.", maxlength: $.validator.format("Mesedez, ez idatzi {0} karaktere baino gehiago."), minlength: $.validator.format("Mesedez, ez idatzi {0} karaktere baino gutxiago."), rangelength: $.validator.format("Mesedez, idatzi {0} eta {1} karaktere arteko balio bat."), range: $.validator.format("Mesedez, idatzi {0} eta {1} arteko balio bat."), max: $.validator.format("Mesedez, idatzi {0} edo txikiagoa den balio bat."), min: $.validator.format("Mesedez, idatzi {0} edo handiagoa den balio bat.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_fa.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: FA (Persian; فارسی) */ $.extend($.validator.messages, { required: "تکمیل این فیلد اجباری است.", remote: "لطفا این فیلد را تصحیح کنید.", email: ".لطفا یک ایمیل صحیح وارد کنید", url: "لطفا آدرس صحیح وارد کنید.", date: "لطفا یک تاریخ صحیح وارد کنید", dateFA: "لطفا یک تاریخ صحیح وارد کنید", dateISO: "لطفا تاریخ صحیح وارد کنید (ISO).", number: "لطفا عدد صحیح وارد کنید.", digits: "لطفا تنها رقم وارد کنید", creditcard: "لطفا کریدیت کارت صحیح وارد کنید.", equalTo: "لطفا مقدار برابری وارد کنید", extension: "لطفا مقداری وارد کنید که ", maxlength: $.validator.format("لطفا بیشتر از {0} حرف وارد نکنید."), minlength: $.validator.format("لطفا کمتر از {0} حرف وارد نکنید."), rangelength: $.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."), range: $.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."), max: $.validator.format("لطفا مقداری کمتر از {0} حرف وارد کنید."), min: $.validator.format("لطفا مقداری بیشتر از {0} حرف وارد کنید."), minWords: $.validator.format("لطفا حداقل {0} کلمه وارد کنید."), maxWords: $.validator.format("لطفا حداکثر {0} کلمه وارد کنید.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_fi.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: FI (Finnish; suomi, suomen kieli) */ $.extend($.validator.messages, { required: "Tämä kenttä on pakollinen.", email: "Syötä oikea sähköpostiosoite.", url: "Syötä oikea URL-osoite.", date: "Syötä oikea päivämäärä.", dateISO: "Syötä oikea päivämäärä muodossa VVVV-KK-PP.", number: "Syötä luku.", creditcard: "Syötä voimassa oleva luottokorttinumero.", digits: "Syötä pelkästään numeroita.", equalTo: "Syötä sama arvo uudestaan.", maxlength: $.validator.format("Voit syöttää enintään {0} merkkiä."), minlength: $.validator.format("Vähintään {0} merkkiä."), rangelength: $.validator.format("Syötä vähintään {0} ja enintään {1} merkkiä."), range: $.validator.format("Syötä arvo väliltä {0}–{1}."), max: $.validator.format("Syötä arvo, joka on enintään {0}."), min: $.validator.format("Syötä arvo, joka on vähintään {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_fr.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: FR (French; français) */ $.extend($.validator.messages, { required: "Ce champ est obligatoire.", remote: "Veuillez corriger ce champ.", email: "Veuillez fournir une adresse électronique valide.", url: "Veuillez fournir une adresse URL valide.", date: "Veuillez fournir une date valide.", dateISO: "Veuillez fournir une date valide (ISO).", number: "Veuillez fournir un numéro valide.", digits: "Veuillez fournir seulement des chiffres.", creditcard: "Veuillez fournir un numéro de carte de crédit valide.", equalTo: "Veuillez fournir encore la même valeur.", extension: "Veuillez fournir une valeur avec une extension valide.", maxlength: $.validator.format("Veuillez fournir au plus {0} caractères."), minlength: $.validator.format("Veuillez fournir au moins {0} caractères."), rangelength: $.validator.format("Veuillez fournir une valeur qui contient entre {0} et {1} caractères."), range: $.validator.format("Veuillez fournir une valeur entre {0} et {1}."), max: $.validator.format("Veuillez fournir une valeur inférieure ou égale à {0}."), min: $.validator.format("Veuillez fournir une valeur supérieure ou égale à {0}."), maxWords: $.validator.format("Veuillez fournir au plus {0} mots."), minWords: $.validator.format("Veuillez fournir au moins {0} mots."), rangeWords: $.validator.format("Veuillez fournir entre {0} et {1} mots."), letterswithbasicpunc: "Veuillez fournir seulement des lettres et des signes de ponctuation.", alphanumeric: "Veuillez fournir seulement des lettres, nombres, espaces et soulignages.", lettersonly: "Veuillez fournir seulement des lettres.", nowhitespace: "Veuillez ne pas inscrire d'espaces blancs.", ziprange: "Veuillez fournir un code postal entre 902xx-xxxx et 905-xx-xxxx.", integer: "Veuillez fournir un nombre non décimal qui est positif ou négatif.", vinUS: "Veuillez fournir un numéro d'identification du véhicule (VIN).", dateITA: "Veuillez fournir une date valide.", time: "Veuillez fournir une heure valide entre 00:00 et 23:59.", phoneUS: "Veuillez fournir un numéro de téléphone valide.", phoneUK: "Veuillez fournir un numéro de téléphone valide.", mobileUK: "Veuillez fournir un numéro de téléphone mobile valide.", strippedminlength: $.validator.format("Veuillez fournir au moins {0} caractères."), email2: "Veuillez fournir une adresse électronique valide.", url2: "Veuillez fournir une adresse URL valide.", creditcardtypes: "Veuillez fournir un numéro de carte de crédit valide.", ipv4: "Veuillez fournir une adresse IP v4 valide.", ipv6: "Veuillez fournir une adresse IP v6 valide.", require_from_group: "Veuillez fournir au moins {0} de ces champs.", nifES: "Veuillez fournir un numéro NIF valide.", nieES: "Veuillez fournir un numéro NIE valide.", cifES: "Veuillez fournir un numéro CIF valide.", postalCodeCA: "Veuillez fournir un code postal valide." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_ge.js ================================================ /** * @author @tatocaster * Translated default messages for the jQuery validation plugin. * Locale: GE (Georgian; ქართული) */ $.extend($.validator.messages, { required: "ეს ველი სავალდებულოა", remote: "გთხოვთ შეასწოროთ.", email: "გთხოვთ შეიყვანოთ სწორი ფორმატით.", url: "გთხოვთ შეიყვანოთ სწორი ფორმატით.", date: "გთხოვთ შეიყვანოთ სწორი თარიღი.", dateISO: "გთხოვთ შეიყვანოთ სწორი ფორმატით ( ISO ).", number: "გთხოვთ შეიყვანოთ რიცხვი.", digits: "დაშვებულია მხოლოდ ციფრები.", creditcard: "გთხოვთ შეიყვანოთ სწორი ფორმატის ბარათის კოდი.", equalTo: "გთხოვთ შეიყვანოთ იგივე მნიშვნელობა.", maxlength: $.validator.format( "გთხოვთ შეიყვანოთ არა უმეტეს {0} სიმბოლოსი." ), minlength: $.validator.format( "შეიყვანეთ მინიმუმ {0} სიმბოლო." ), rangelength: $.validator.format( "გთხოვთ შეიყვანოთ {0} -დან {1} -მდე რაოდენობის სიმბოლოები." ), range: $.validator.format( "შეიყვანეთ {0} -სა {1} -ს შორის." ), max: $.validator.format( "გთხოვთ შეიყვანოთ მნიშვნელობა ნაკლები ან ტოლი {0} -ს." ), min: $.validator.format( "გთხოვთ შეიყვანოთ მნიშვნელობა მეტი ან ტოლი {0} -ს." ) }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_gl.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: GL (Galician; Galego) */ (function($) { $.extend($.validator.messages, { required: "Este campo é obrigatorio.", remote: "Por favor, cubre este campo.", email: "Por favor, escribe unha dirección de correo válida.", url: "Por favor, escribe unha URL válida.", date: "Por favor, escribe unha data válida.", dateISO: "Por favor, escribe unha data (ISO) válida.", number: "Por favor, escribe un número válido.", digits: "Por favor, escribe só díxitos.", creditcard: "Por favor, escribe un número de tarxeta válido.", equalTo: "Por favor, escribe o mesmo valor de novo.", extension: "Por favor, escribe un valor cunha extensión aceptada.", maxlength: $.validator.format("Por favor, non escribas máis de {0} caracteres."), minlength: $.validator.format("Por favor, non escribas menos de {0} caracteres."), rangelength: $.validator.format("Por favor, escribe un valor entre {0} e {1} caracteres."), range: $.validator.format("Por favor, escribe un valor entre {0} e {1}."), max: $.validator.format("Por favor, escribe un valor menor ou igual a {0}."), min: $.validator.format("Por favor, escribe un valor maior ou igual a {0}."), nifES: "Por favor, escribe un NIF válido.", nieES: "Por favor, escribe un NIE válido.", cifES: "Por favor, escribe un CIF válido." }); }(jQuery)); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_he.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: HE (Hebrew; עברית) */ $.extend($.validator.messages, { required: "השדה הזה הינו שדה חובה", remote: "נא לתקן שדה זה", email: "נא למלא כתובת דוא\"ל חוקית", url: "נא למלא כתובת אינטרנט חוקית", date: "נא למלא תאריך חוקי", dateISO: "נא למלא תאריך חוקי (ISO)", number: "נא למלא מספר", digits: "נא למלא רק מספרים", creditcard: "נא למלא מספר כרטיס אשראי חוקי", equalTo: "נא למלא את אותו ערך שוב", extension: "נא למלא ערך עם סיומת חוקית", maxlength: $.validator.format(".נא לא למלא יותר מ- {0} תווים"), minlength: $.validator.format("נא למלא לפחות {0} תווים"), rangelength: $.validator.format("נא למלא ערך בין {0} ל- {1} תווים"), range: $.validator.format("נא למלא ערך בין {0} ל- {1}"), max: $.validator.format("נא למלא ערך קטן או שווה ל- {0}"), min: $.validator.format("נא למלא ערך גדול או שווה ל- {0}") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_hr.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: HR (Croatia; hrvatski jezik) */ $.extend($.validator.messages, { required: "Ovo polje je obavezno.", remote: "Ovo polje treba popraviti.", email: "Unesite ispravnu e-mail adresu.", url: "Unesite ispravan URL.", date: "Unesite ispravan datum.", dateISO: "Unesite ispravan datum (ISO).", number: "Unesite ispravan broj.", digits: "Unesite samo brojeve.", creditcard: "Unesite ispravan broj kreditne kartice.", equalTo: "Unesite ponovo istu vrijednost.", extension: "Unesite vrijednost sa ispravnom ekstenzijom.", maxlength: $.validator.format("Maksimalni broj znakova je {0} ."), minlength: $.validator.format("Minimalni broj znakova je {0} ."), rangelength: $.validator.format("Unesite vrijednost između {0} i {1} znakova."), range: $.validator.format("Unesite vrijednost između {0} i {1}."), max: $.validator.format("Unesite vrijednost manju ili jednaku {0}."), min: $.validator.format("Unesite vrijednost veću ili jednaku {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_hu.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: HU (Hungarian; Magyar) */ $.extend($.validator.messages, { required: "Kötelező megadni.", maxlength: $.validator.format("Legfeljebb {0} karakter hosszú legyen."), minlength: $.validator.format("Legalább {0} karakter hosszú legyen."), rangelength: $.validator.format("Legalább {0} és legfeljebb {1} karakter hosszú legyen."), email: "Érvényes e-mail címnek kell lennie.", url: "Érvényes URL-nek kell lennie.", date: "Dátumnak kell lennie.", number: "Számnak kell lennie.", digits: "Csak számjegyek lehetnek.", equalTo: "Meg kell egyeznie a két értéknek.", range: $.validator.format("{0} és {1} közé kell esnie."), max: $.validator.format("Nem lehet nagyobb, mint {0}."), min: $.validator.format("Nem lehet kisebb, mint {0}."), creditcard: "Érvényes hitelkártyaszámnak kell lennie.", remote: "Kérem javítsa ki ezt a mezőt.", dateISO: "Kérem írjon be egy érvényes dátumot (ISO)." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_hy_AM.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: HY_AM (Armenian; հայերեն լեզու) */ $.extend($.validator.messages, { required: "Պարտադիր լրացման դաշտ", remote: "Ներմուծեք ճիշտ արժեքը", email: "Ներմուծեք վավեր էլեկտրոնային փոստի հասցե", url: "Ներմուծեք վավեր URL", date: "Ներմուծեք վավեր ամսաթիվ", dateISO: "Ներմուծեք ISO ֆորմատով վավեր ամսաթիվ։", number: "Ներմուծեք թիվ", digits: "Ներմուծեք միայն թվեր", creditcard: "Ներմուծեք ճիշտ բանկային քարտի համար", equalTo: "Ներմուծեք միևնուն արժեքը ևս մեկ անգամ", extension: "Ընտրեք ճիշտ ընդլանումով ֆայլ", maxlength: $.validator.format("Ներմուծեք ոչ ավել քան {0} նիշ"), minlength: $.validator.format("Ներմուծեք ոչ պակաս քան {0} նիշ"), rangelength: $.validator.format("Ներմուծեք {0}֊ից {1} երկարությամբ արժեք"), range: $.validator.format("Ներմուծեք թիվ {0}֊ից {1} միջակայքում"), max: $.validator.format("Ներմուծեք թիվ, որը փոքր կամ հավասար է {0}֊ին"), min: $.validator.format("Ներմուծեք թիվ, որը մեծ կամ հավասար է {0}֊ին") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_id.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: ID (Indonesia; Indonesian) */ $.extend($.validator.messages, { required: "Kolom ini diperlukan.", remote: "Harap benarkan kolom ini.", email: "Silakan masukkan format email yang benar.", url: "Silakan masukkan format URL yang benar.", date: "Silakan masukkan format tanggal yang benar.", dateISO: "Silakan masukkan format tanggal(ISO) yang benar.", number: "Silakan masukkan angka yang benar.", digits: "Harap masukan angka saja.", creditcard: "Harap masukkan format kartu kredit yang benar.", equalTo: "Harap masukkan nilai yg sama dengan sebelumnya.", maxlength: $.validator.format("Input dibatasi hanya {0} karakter."), minlength: $.validator.format("Input tidak kurang dari {0} karakter."), rangelength: $.validator.format("Panjang karakter yg diizinkan antara {0} dan {1} karakter."), range: $.validator.format("Harap masukkan nilai antara {0} dan {1}."), max: $.validator.format("Harap masukkan nilai lebih kecil atau sama dengan {0}."), min: $.validator.format("Harap masukkan nilai lebih besar atau sama dengan {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_is.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: IS (Icelandic; íslenska) */ $.extend($.validator.messages, { required: "Þessi reitur er nauðsynlegur.", remote: "Lagaðu þennan reit.", maxlength: $.validator.format("Sláðu inn mest {0} stafi."), minlength: $.validator.format("Sláðu inn minnst {0} stafi."), rangelength: $.validator.format("Sláðu inn minnst {0} og mest {1} stafi."), email: "Sláðu inn gilt netfang.", url: "Sláðu inn gilda vefslóð.", date: "Sláðu inn gilda dagsetningu.", number: "Sláðu inn tölu.", digits: "Sláðu inn tölustafi eingöngu.", equalTo: "Sláðu sama gildi inn aftur.", range: $.validator.format("Sláðu inn gildi milli {0} og {1}."), max: $.validator.format("Sláðu inn gildi sem er minna en eða jafnt og {0}."), min: $.validator.format("Sláðu inn gildi sem er stærra en eða jafnt og {0}."), creditcard: "Sláðu inn gilt greiðslukortanúmer." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_it.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: IT (Italian; Italiano) */ $.extend($.validator.messages, { required: "Campo obbligatorio", remote: "Controlla questo campo", email: "Inserisci un indirizzo email valido", url: "Inserisci un indirizzo web valido", date: "Inserisci una data valida", dateISO: "Inserisci una data valida (ISO)", number: "Inserisci un numero valido", digits: "Inserisci solo numeri", creditcard: "Inserisci un numero di carta di credito valido", equalTo: "Il valore non corrisponde", extension: "Inserisci un valore con un'estensione valida", maxlength: $.validator.format("Non inserire più di {0} caratteri"), minlength: $.validator.format("Inserisci almeno {0} caratteri"), rangelength: $.validator.format("Inserisci un valore compreso tra {0} e {1} caratteri"), range: $.validator.format("Inserisci un valore compreso tra {0} e {1}"), max: $.validator.format("Inserisci un valore minore o uguale a {0}"), min: $.validator.format("Inserisci un valore maggiore o uguale a {0}"), nifES: "Inserisci un NIF valido", nieES: "Inserisci un NIE valido", cifES: "Inserisci un CIF valido", currency: "Inserisci una valuta valida" }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_ja.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: JA (Japanese; 日本語) */ $.extend($.validator.messages, { required: "このフィールドは必須です。", remote: "このフィールドを修正してください。", email: "有効なEメールアドレスを入力してください。", url: "有効なURLを入力してください。", date: "有効な日付を入力してください。", dateISO: "有効な日付(ISO)を入力してください。", number: "有効な数字を入力してください。", digits: "数字のみを入力してください。", creditcard: "有効なクレジットカード番号を入力してください。", equalTo: "同じ値をもう一度入力してください。", extension: "有効な拡張子を含む値を入力してください。", maxlength: $.validator.format("{0} 文字以内で入力してください。"), minlength: $.validator.format("{0} 文字以上で入力してください。"), rangelength: $.validator.format("{0} 文字から {1} 文字までの値を入力してください。"), range: $.validator.format("{0} から {1} までの値を入力してください。"), max: $.validator.format("{0} 以下の値を入力してください。"), min: $.validator.format("{0} 以上の値を入力してください。") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_ka.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: KA (Georgian; ქართული) */ $.extend($.validator.messages, { required: "ამ ველის შევსება აუცილებელია.", remote: "გთხოვთ მიუთითოთ სწორი მნიშვნელობა.", email: "გთხოვთ მიუთითოთ ელ-ფოსტის კორექტული მისამართი.", url: "გთხოვთ მიუთითოთ კორექტული URL.", date: "გთხოვთ მიუთითოთ კორექტული თარიღი.", dateISO: "გთხოვთ მიუთითოთ კორექტული თარიღი ISO ფორმატში.", number: "გთხოვთ მიუთითოთ ციფრი.", digits: "გთხოვთ მიუთითოთ მხოლოდ ციფრები.", creditcard: "გთხოვთ მიუთითოთ საკრედიტო ბარათის კორექტული ნომერი.", equalTo: "გთხოვთ მიუთითოთ ასეთივე მნიშვნელობა კიდევ ერთხელ.", extension: "გთხოვთ აირჩიოთ ფაილი კორექტული გაფართოებით.", maxlength: $.validator.format("დასაშვებია არაუმეტეს {0} სიმბოლო."), minlength: $.validator.format("აუცილებელია შეიყვანოთ მინიმუმ {0} სიმბოლო."), rangelength: $.validator.format("ტექსტში სიმბოლოების რაოდენობა უნდა იყოს {0}-დან {1}-მდე."), range: $.validator.format("გთხოვთ შეიყვანოთ ციფრი {0}-დან {1}-მდე."), max: $.validator.format("გთხოვთ შეიყვანოთ ციფრი რომელიც ნაკლებია ან უდრის {0}-ს."), min: $.validator.format("გთხოვთ შეიყვანოთ ციფრი რომელიც მეტია ან უდრის {0}-ს.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_kk.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: KK (Kazakh; қазақ тілі) */ $.extend($.validator.messages, { required: "Бұл өрісті міндетті түрде толтырыңыз.", remote: "Дұрыс мағына енгізуіңізді сұраймыз.", email: "Нақты электронды поштаңызды енгізуіңізді сұраймыз.", url: "Нақты URL-ды енгізуіңізді сұраймыз.", date: "Нақты URL-ды енгізуіңізді сұраймыз.", dateISO: "Нақты ISO форматымен сәйкес датасын енгізуіңізді сұраймыз.", number: "Күнді енгізуіңізді сұраймыз.", digits: "Тек қана сандарды енгізуіңізді сұраймыз.", creditcard: "Несие картасының нөмірін дұрыс енгізуіңізді сұраймыз.", equalTo: "Осы мәнді қайта енгізуіңізді сұраймыз.", extension: "Файлдың кеңейтуін дұрыс таңдаңыз.", maxlength: $.validator.format("Ұзындығы {0} символдан көр болмасын."), minlength: $.validator.format("Ұзындығы {0} символдан аз болмасын."), rangelength: $.validator.format("Ұзындығы {0}-{1} дейін мән енгізуіңізді сұраймыз."), range: $.validator.format("Пожалуйста, введите число от {0} до {1}. - {0} - {1} санын енгізуіңізді сұраймыз."), max: $.validator.format("{0} аз немесе тең санын енгізуіңіді сұраймыз."), min: $.validator.format("{0} көп немесе тең санын енгізуіңізді сұраймыз.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_ko.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: KO (Korean; 한국어) */ $.extend($.validator.messages, { required: "필수 항목입니다.", remote: "항목을 수정하세요.", email: "유효하지 않은 E-Mail주소입니다.", url: "유효하지 않은 URL입니다.", date: "올바른 날짜를 입력하세요.", dateISO: "올바른 날짜(ISO)를 입력하세요.", number: "유효한 숫자가 아닙니다.", digits: "숫자만 입력 가능합니다.", creditcard: "신용카드 번호가 바르지 않습니다.", equalTo: "같은 값을 다시 입력하세요.", extension: "올바른 확장자가 아닙니다.", maxlength: $.validator.format("{0}자를 넘을 수 없습니다. "), minlength: $.validator.format("{0}자 이상 입력하세요."), rangelength: $.validator.format("문자 길이가 {0} 에서 {1} 사이의 값을 입력하세요."), range: $.validator.format("{0} 에서 {1} 사이의 값을 입력하세요."), max: $.validator.format("{0} 이하의 값을 입력하세요."), min: $.validator.format("{0} 이상의 값을 입력하세요.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_lt.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: LT (Lithuanian; lietuvių kalba) */ $.extend($.validator.messages, { required: "Šis laukas yra privalomas.", remote: "Prašau pataisyti šį lauką.", email: "Prašau įvesti teisingą elektroninio pašto adresą.", url: "Prašau įvesti teisingą URL.", date: "Prašau įvesti teisingą datą.", dateISO: "Prašau įvesti teisingą datą (ISO).", number: "Prašau įvesti teisingą skaičių.", digits: "Prašau naudoti tik skaitmenis.", creditcard: "Prašau įvesti teisingą kreditinės kortelės numerį.", equalTo: "Prašau įvestį tą pačią reikšmę dar kartą.", extension: "Prašau įvesti reikšmę su teisingu plėtiniu.", maxlength: $.validator.format("Prašau įvesti ne daugiau kaip {0} simbolių."), minlength: $.validator.format("Prašau įvesti bent {0} simbolius."), rangelength: $.validator.format("Prašau įvesti reikšmes, kurių ilgis nuo {0} iki {1} simbolių."), range: $.validator.format("Prašau įvesti reikšmę intervale nuo {0} iki {1}."), max: $.validator.format("Prašau įvesti reikšmę mažesnę arba lygią {0}."), min: $.validator.format("Prašau įvesti reikšmę didesnę arba lygią {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_lv.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: LV (Latvian; latviešu valoda) */ $.extend($.validator.messages, { required: "Šis lauks ir obligāts.", remote: "Lūdzu, pārbaudiet šo lauku.", email: "Lūdzu, ievadiet derīgu e-pasta adresi.", url: "Lūdzu, ievadiet derīgu URL adresi.", date: "Lūdzu, ievadiet derīgu datumu.", dateISO: "Lūdzu, ievadiet derīgu datumu (ISO).", number: "Lūdzu, ievadiet derīgu numuru.", digits: "Lūdzu, ievadiet tikai ciparus.", creditcard: "Lūdzu, ievadiet derīgu kredītkartes numuru.", equalTo: "Lūdzu, ievadiet to pašu vēlreiz.", extension: "Lūdzu, ievadiet vērtību ar derīgu paplašinājumu.", maxlength: $.validator.format("Lūdzu, ievadiet ne vairāk kā {0} rakstzīmes."), minlength: $.validator.format("Lūdzu, ievadiet vismaz {0} rakstzīmes."), rangelength: $.validator.format("Lūdzu ievadiet {0} līdz {1} rakstzīmes."), range: $.validator.format("Lūdzu, ievadiet skaitli no {0} līdz {1}."), max: $.validator.format("Lūdzu, ievadiet skaitli, kurš ir mazāks vai vienāds ar {0}."), min: $.validator.format("Lūdzu, ievadiet skaitli, kurš ir lielāks vai vienāds ar {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_my.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: MY (Malay; Melayu) */ $.extend($.validator.messages, { required: "Medan ini diperlukan.", remote: "Sila betulkan medan ini.", email: "Sila masukkan alamat emel yang betul.", url: "Sila masukkan URL yang betul.", date: "Sila masukkan tarikh yang betul.", dateISO: "Sila masukkan tarikh(ISO) yang betul.", number: "Sila masukkan nombor yang betul.", digits: "Sila masukkan nilai digit sahaja.", creditcard: "Sila masukkan nombor kredit kad yang betul.", equalTo: "Sila masukkan nilai yang sama semula.", extension: "Sila masukkan nilai yang telah diterima.", maxlength: $.validator.format("Sila masukkan nilai tidak lebih dari {0} aksara."), minlength: $.validator.format("Sila masukkan nilai sekurang-kurangnya {0} aksara."), rangelength: $.validator.format("Sila masukkan panjang nilai antara {0} dan {1} aksara."), range: $.validator.format("Sila masukkan nilai antara {0} dan {1} aksara."), max: $.validator.format("Sila masukkan nilai yang kurang atau sama dengan {0}."), min: $.validator.format("Sila masukkan nilai yang lebih atau sama dengan {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_nl.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: NL (Dutch; Nederlands, Vlaams) */ $.extend($.validator.messages, { required: "Dit is een verplicht veld.", remote: "Controleer dit veld.", email: "Vul hier een geldig e-mailadres in.", url: "Vul hier een geldige URL in.", date: "Vul hier een geldige datum in.", dateISO: "Vul hier een geldige datum in (ISO-formaat).", number: "Vul hier een geldig getal in.", digits: "Vul hier alleen getallen in.", creditcard: "Vul hier een geldig creditcardnummer in.", equalTo: "Vul hier dezelfde waarde in.", extension: "Vul hier een waarde in met een geldige extensie.", maxlength: $.validator.format("Vul hier maximaal {0} tekens in."), minlength: $.validator.format("Vul hier minimaal {0} tekens in."), rangelength: $.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1} tekens."), range: $.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1}."), max: $.validator.format("Vul hier een waarde in kleiner dan of gelijk aan {0}."), min: $.validator.format("Vul hier een waarde in groter dan of gelijk aan {0}."), // for validations in additional-methods.js iban: "Vul hier een geldig IBAN in.", dateNL: "Vul hier een geldige datum in.", phoneNL: "Vul hier een geldig Nederlands telefoonnummer in.", mobileNL: "Vul hier een geldig Nederlands mobiel telefoonnummer in.", postalcodeNL: "Vul hier een geldige postcode in.", bankaccountNL: "Vul hier een geldig bankrekeningnummer in.", giroaccountNL: "Vul hier een geldig gironummer in.", bankorgiroaccountNL: "Vul hier een geldig bank- of gironummer in." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_no.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: NO (Norwegian; Norsk) */ $.extend($.validator.messages, { required: "Dette feltet er obligatorisk.", maxlength: $.validator.format("Maksimalt {0} tegn."), minlength: $.validator.format("Minimum {0} tegn."), rangelength: $.validator.format("Angi minimum {0} og maksimum {1} tegn."), email: "Oppgi en gyldig epostadresse.", url: "Angi en gyldig URL.", date: "Angi en gyldig dato.", dateISO: "Angi en gyldig dato (&ARING;&ARING;&ARING;&ARING;-MM-DD).", dateSE: "Angi en gyldig dato.", number: "Angi et gyldig nummer.", numberSE: "Angi et gyldig nummer.", digits: "Skriv kun tall.", equalTo: "Skriv samme verdi igjen.", range: $.validator.format("Angi en verdi mellom {0} og {1}."), max: $.validator.format("Angi en verdi som er mindre eller lik {0}."), min: $.validator.format("Angi en verdi som er større eller lik {0}."), creditcard: "Angi et gyldig kredittkortnummer." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_pl.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: PL (Polish; język polski, polszczyzna) */ $.extend($.validator.messages, { required: "To pole jest wymagane.", remote: "Proszę o wypełnienie tego pola.", email: "Proszę o podanie prawidłowego adresu email.", url: "Proszę o podanie prawidłowego URL.", date: "Proszę o podanie prawidłowej daty.", dateISO: "Proszę o podanie prawidłowej daty (ISO).", number: "Proszę o podanie prawidłowej liczby.", digits: "Proszę o podanie samych cyfr.", creditcard: "Proszę o podanie prawidłowej karty kredytowej.", equalTo: "Proszę o podanie tej samej wartości ponownie.", extension: "Proszę o podanie wartości z prawidłowym rozszerzeniem.", maxlength: $.validator.format("Proszę o podanie nie więcej niż {0} znaków."), minlength: $.validator.format("Proszę o podanie przynajmniej {0} znaków."), rangelength: $.validator.format("Proszę o podanie wartości o długości od {0} do {1} znaków."), range: $.validator.format("Proszę o podanie wartości z przedziału od {0} do {1}."), max: $.validator.format("Proszę o podanie wartości mniejszej bądź równej {0}."), min: $.validator.format("Proszę o podanie wartości większej bądź równej {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_pt_BR.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: PT (Portuguese; português) * Region: BR (Brazil) */ $.extend($.validator.messages, { required: "Este campo é requerido.", remote: "Por favor, corrija este campo.", email: "Por favor, forneça um endereço de email válido.", url: "Por favor, forneça uma URL válida.", date: "Por favor, forneça uma data válida.", dateISO: "Por favor, forneça uma data válida (ISO).", number: "Por favor, forneça um número válido.", digits: "Por favor, forneça somente dígitos.", creditcard: "Por favor, forneça um cartão de crédito válido.", equalTo: "Por favor, forneça o mesmo valor novamente.", extension: "Por favor, forneça um valor com uma extensão válida.", maxlength: $.validator.format("Por favor, forneça não mais que {0} caracteres."), minlength: $.validator.format("Por favor, forneça ao menos {0} caracteres."), rangelength: $.validator.format("Por favor, forneça um valor entre {0} e {1} caracteres de comprimento."), range: $.validator.format("Por favor, forneça um valor entre {0} e {1}."), max: $.validator.format("Por favor, forneça um valor menor ou igual a {0}."), min: $.validator.format("Por favor, forneça um valor maior ou igual a {0}."), nifES: "Por favor, forneça um NIF válido.", nieES: "Por favor, forneça um NIE válido.", cifEE: "Por favor, forneça um CIF válido.", postalcodeBR: "Por favor, forneça um CEP válido.", cpfBR: "Por favor, forneça um CPF válido." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_pt_PT.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: PT (Portuguese; português) * Region: PT (Portugal) */ $.extend($.validator.messages, { required: "Campo de preenchimento obrigatório.", remote: "Por favor, corrija este campo.", email: "Por favor, introduza um endereço eletrónico válido.", url: "Por favor, introduza um URL válido.", date: "Por favor, introduza uma data válida.", dateISO: "Por favor, introduza uma data válida (ISO).", number: "Por favor, introduza um número válido.", digits: "Por favor, introduza apenas dígitos.", creditcard: "Por favor, introduza um número de cartão de crédito válido.", equalTo: "Por favor, introduza de novo o mesmo valor.", extension: "Por favor, introduza um ficheiro com uma extensão válida.", maxlength: $.validator.format("Por favor, não introduza mais do que {0} caracteres."), minlength: $.validator.format("Por favor, introduza pelo menos {0} caracteres."), rangelength: $.validator.format("Por favor, introduza entre {0} e {1} caracteres."), range: $.validator.format("Por favor, introduza um valor entre {0} e {1}."), max: $.validator.format("Por favor, introduza um valor menor ou igual a {0}."), min: $.validator.format("Por favor, introduza um valor maior ou igual a {0}."), nifES: "Por favor, introduza um NIF válido.", nieES: "Por favor, introduza um NIE válido.", cifES: "Por favor, introduza um CIF válido." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_ro.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: RO (Romanian, limba română) */ $.extend($.validator.messages, { required: "Acest câmp este obligatoriu.", remote: "Te rugăm să completezi acest câmp.", email: "Te rugăm să introduci o adresă de email validă", url: "Te rugăm sa introduci o adresă URL validă.", date: "Te rugăm să introduci o dată corectă.", dateISO: "Te rugăm să introduci o dată (ISO) corectă.", number: "Te rugăm să introduci un număr întreg valid.", digits: "Te rugăm să introduci doar cifre.", creditcard: "Te rugăm să introduci un numar de carte de credit valid.", equalTo: "Te rugăm să reintroduci valoarea.", extension: "Te rugăm să introduci o valoare cu o extensie validă.", maxlength: $.validator.format("Te rugăm să nu introduci mai mult de {0} caractere."), minlength: $.validator.format("Te rugăm să introduci cel puțin {0} caractere."), rangelength: $.validator.format("Te rugăm să introduci o valoare între {0} și {1} caractere."), range: $.validator.format("Te rugăm să introduci o valoare între {0} și {1}."), max: $.validator.format("Te rugăm să introduci o valoare egal sau mai mică decât {0}."), min: $.validator.format("Te rugăm să introduci o valoare egal sau mai mare decât {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_ru.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: RU (Russian; русский язык) */ $.extend($.validator.messages, { required: "Это поле необходимо заполнить.", remote: "Пожалуйста, введите правильное значение.", email: "Пожалуйста, введите корректный адрес электронной почты.", url: "Пожалуйста, введите корректный URL.", date: "Пожалуйста, введите корректную дату.", dateISO: "Пожалуйста, введите корректную дату в формате ISO.", number: "Пожалуйста, введите число.", digits: "Пожалуйста, вводите только цифры.", creditcard: "Пожалуйста, введите правильный номер кредитной карты.", equalTo: "Пожалуйста, введите такое же значение ещё раз.", extension: "Пожалуйста, выберите файл с правильным расширением.", maxlength: $.validator.format("Пожалуйста, введите не больше {0} символов."), minlength: $.validator.format("Пожалуйста, введите не меньше {0} символов."), rangelength: $.validator.format("Пожалуйста, введите значение длиной от {0} до {1} символов."), range: $.validator.format("Пожалуйста, введите число от {0} до {1}."), max: $.validator.format("Пожалуйста, введите число, меньшее или равное {0}."), min: $.validator.format("Пожалуйста, введите число, большее или равное {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_si.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: SI (Slovenian) */ $.extend($.validator.messages, { required: "To polje je obvezno.", remote: "Vpis v tem polju ni v pravi obliki.", email: "Prosimo, vnesite pravi email naslov.", url: "Prosimo, vnesite pravi URL.", date: "Prosimo, vnesite pravi datum.", dateISO: "Prosimo, vnesite pravi datum (ISO).", number: "Prosimo, vnesite pravo številko.", digits: "Prosimo, vnesite samo številke.", creditcard: "Prosimo, vnesite pravo številko kreditne kartice.", equalTo: "Prosimo, ponovno vnesite enako vsebino.", extension: "Prosimo, vnesite vsebino z pravo končnico.", maxlength: $.validator.format("Prosimo, da ne vnašate več kot {0} znakov."), minlength: $.validator.format("Prosimo, vnesite vsaj {0} znakov."), rangelength: $.validator.format("Prosimo, vnesite od {0} do {1} znakov."), range: $.validator.format("Prosimo, vnesite vrednost med {0} in {1}."), max: $.validator.format("Prosimo, vnesite vrednost manjšo ali enako {0}."), min: $.validator.format("Prosimo, vnesite vrednost večjo ali enako {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_sk.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: SK (Slovak; slovenčina, slovenský jazyk) */ $.extend($.validator.messages, { required: "Povinné zadať.", maxlength: $.validator.format("Maximálne {0} znakov."), minlength: $.validator.format("Minimálne {0} znakov."), rangelength: $.validator.format("Minimálne {0} a Maximálne {1} znakov."), email: "E-mailová adresa musí byť platná.", url: "URL musí byť platný.", date: "Musí byť dátum.", number: "Musí byť číslo.", digits: "Môže obsahovať iba číslice.", equalTo: "Dva hodnoty sa musia rovnať.", range: $.validator.format("Musí byť medzi {0} a {1}."), max: $.validator.format("Nemôže byť viac ako{0}."), min: $.validator.format("Nemôže byť menej ako{0}."), creditcard: "Číslo platobnej karty musí byť platné." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_sl.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Language: SL (Slovenian; slovenski jezik) */ $.extend($.validator.messages, { required: "To polje je obvezno.", remote: "Prosimo popravite to polje.", email: "Prosimo vnesite veljaven email naslov.", url: "Prosimo vnesite veljaven URL naslov.", date: "Prosimo vnesite veljaven datum.", dateISO: "Prosimo vnesite veljaven ISO datum.", number: "Prosimo vnesite veljavno število.", digits: "Prosimo vnesite samo števila.", creditcard: "Prosimo vnesite veljavno številko kreditne kartice.", equalTo: "Prosimo ponovno vnesite vrednost.", extension: "Prosimo vnesite vrednost z veljavno končnico.", maxlength: $.validator.format("Prosimo vnesite največ {0} znakov."), minlength: $.validator.format("Prosimo vnesite najmanj {0} znakov."), rangelength: $.validator.format("Prosimo vnesite najmanj {0} in največ {1} znakov."), range: $.validator.format("Prosimo vnesite vrednost med {0} in {1}."), max: $.validator.format("Prosimo vnesite vrednost manjše ali enako {0}."), min: $.validator.format("Prosimo vnesite vrednost večje ali enako {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_sr.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: SR (Serbian; српски језик) */ $.extend($.validator.messages, { required: "Поље је обавезно.", remote: "Средите ово поље.", email: "Унесите исправну и-мејл адресу.", url: "Унесите исправан URL.", date: "Унесите исправан датум.", dateISO: "Унесите исправан датум (ISO).", number: "Унесите исправан број.", digits: "Унесите само цифе.", creditcard: "Унесите исправан број кредитне картице.", equalTo: "Унесите исту вредност поново.", extension: "Унесите вредност са одговарајућом екстензијом.", maxlength: $.validator.format("Унесите мање од {0} карактера."), minlength: $.validator.format("Унесите барем {0} карактера."), rangelength: $.validator.format("Унесите вредност дугачку између {0} и {1} карактера."), range: $.validator.format("Унесите вредност између {0} и {1}."), max: $.validator.format("Унесите вредност мању или једнаку {0}."), min: $.validator.format("Унесите вредност већу или једнаку {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_sr_lat.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: SR (Serbian - Latin alphabet; srpski jezik - latinica) */ $.extend($.validator.messages, { required: "Polje je obavezno.", remote: "Sredite ovo polje.", email: "Unesite ispravnu e-mail adresu", url: "Unesite ispravan URL.", date: "Unesite ispravan datum.", dateISO: "Unesite ispravan datum (ISO).", number: "Unesite ispravan broj.", digits: "Unesite samo cifre.", creditcard: "Unesite ispravan broj kreditne kartice.", equalTo: "Unesite istu vrednost ponovo.", extension: "Unesite vrednost sa odgovarajućom ekstenzijom.", maxlength: $.validator.format("Unesite manje od {0} karaktera."), minlength: $.validator.format("Unesite barem {0} karaktera."), rangelength: $.validator.format("Unesite vrednost dugačku između {0} i {1} karaktera."), range: $.validator.format("Unesite vrednost između {0} i {1}."), max: $.validator.format("Unesite vrednost manju ili jednaku {0}."), min: $.validator.format("Unesite vrednost veću ili jednaku {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_sv.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: SV (Swedish; Svenska) */ $.extend($.validator.messages, { required: "Detta fält är obligatoriskt.", maxlength: $.validator.format("Du får ange högst {0} tecken."), minlength: $.validator.format("Du måste ange minst {0} tecken."), rangelength: $.validator.format("Ange minst {0} och max {1} tecken."), email: "Ange en korrekt e-postadress.", url: "Ange en korrekt URL.", date: "Ange ett korrekt datum.", dateISO: "Ange ett korrekt datum (ÅÅÅÅ-MM-DD).", number: "Ange ett korrekt nummer.", digits: "Ange endast siffror.", equalTo: "Ange samma värde igen.", range: $.validator.format("Ange ett värde mellan {0} och {1}."), max: $.validator.format("Ange ett värde som är mindre eller lika med {0}."), min: $.validator.format("Ange ett värde som är större eller lika med {0}."), creditcard: "Ange ett korrekt kreditkortsnummer." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_th.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: TH (Thai; ไทย) */ $.extend($.validator.messages, { required: "โปรดระบุ", remote: "โปรดแก้ไขให้ถูกต้อง", email: "โปรดระบุที่อยู่อีเมล์ที่ถูกต้อง", url: "โปรดระบุ URL ที่ถูกต้อง", date: "โปรดระบุวันที่ ที่ถูกต้อง", dateISO: "โปรดระบุวันที่ ที่ถูกต้อง (ระบบ ISO).", number: "โปรดระบุทศนิยมที่ถูกต้อง", digits: "โปรดระบุจำนวนเต็มที่ถูกต้อง", creditcard: "โปรดระบุรหัสบัตรเครดิตที่ถูกต้อง", equalTo: "โปรดระบุค่าเดิมอีกครั้ง", extension: "โปรดระบุค่าที่มีส่วนขยายที่ถูกต้อง", maxlength: $.validator.format("โปรดอย่าระบุค่าที่ยาวกว่า {0} อักขระ"), minlength: $.validator.format("โปรดอย่าระบุค่าที่สั้นกว่า {0} อักขระ"), rangelength: $.validator.format("โปรดอย่าระบุค่าความยาวระหว่าง {0} ถึง {1} อักขระ"), range: $.validator.format("โปรดระบุค่าระหว่าง {0} และ {1}"), max: $.validator.format("โปรดระบุค่าน้อยกว่าหรือเท่ากับ {0}"), min: $.validator.format("โปรดระบุค่ามากกว่าหรือเท่ากับ {0}") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_tj.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: TJ (Tajikistan; Забони тоҷикӣ) */ $.extend($.validator.messages, { required: "Ворид кардани ин филд маҷбури аст.", remote: "Илтимос, маълумоти саҳеҳ ворид кунед.", email: "Илтимос, почтаи электронии саҳеҳ ворид кунед.", url: "Илтимос, URL адреси саҳеҳ ворид кунед.", date: "Илтимос, таърихи саҳеҳ ворид кунед.", dateISO: "Илтимос, таърихи саҳеҳи (ISO)ӣ ворид кунед.", number: "Илтимос, рақамҳои саҳеҳ ворид кунед.", digits: "Илтимос, танҳо рақам ворид кунед.", creditcard: "Илтимос, кредит карди саҳеҳ ворид кунед.", equalTo: "Илтимос, миқдори баробар ворид кунед.", extension: "Илтимос, қофияи файлро дуруст интихоб кунед", maxlength: $.validator.format("Илтимос, бештар аз {0} рамз ворид накунед."), minlength: $.validator.format("Илтимос, камтар аз {0} рамз ворид накунед."), rangelength: $.validator.format("Илтимос, камтар аз {0} ва зиёда аз {1} рамз ворид кунед."), range: $.validator.format("Илтимос, аз {0} то {1} рақам зиёд ворид кунед."), max: $.validator.format("Илтимос, бештар аз {0} рақам ворид накунед."), min: $.validator.format("Илтимос, камтар аз {0} рақам ворид накунед.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_tr.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: TR (Turkish; Türkçe) */ $.extend($.validator.messages, { required: "Bu alanın doldurulması zorunludur.", remote: "Lütfen bu alanı düzeltin.", email: "Lütfen geçerli bir e-posta adresi giriniz.", url: "Lütfen geçerli bir web adresi (URL) giriniz.", date: "Lütfen geçerli bir tarih giriniz.", dateISO: "Lütfen geçerli bir tarih giriniz(ISO formatında)", number: "Lütfen geçerli bir sayı giriniz.", digits: "Lütfen sadece sayısal karakterler giriniz.", creditcard: "Lütfen geçerli bir kredi kartı giriniz.", equalTo: "Lütfen aynı değeri tekrar giriniz.", extension: "Lütfen geçerli uzantıya sahip bir değer giriniz.", maxlength: $.validator.format("Lütfen en fazla {0} karakter uzunluğunda bir değer giriniz."), minlength: $.validator.format("Lütfen en az {0} karakter uzunluğunda bir değer giriniz."), rangelength: $.validator.format("Lütfen en az {0} ve en fazla {1} uzunluğunda bir değer giriniz."), range: $.validator.format("Lütfen {0} ile {1} arasında bir değer giriniz."), max: $.validator.format("Lütfen {0} değerine eşit ya da daha küçük bir değer giriniz."), min: $.validator.format("Lütfen {0} değerine eşit ya da daha büyük bir değer giriniz."), require_from_group: "Lütfen bu alanların en az {0} tanesini doldurunuz." }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_uk.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: UK (Ukrainian; українська мова) */ $.extend($.validator.messages, { required: "Це поле необхідно заповнити.", remote: "Будь ласка, введіть правильне значення.", email: "Будь ласка, введіть коректну адресу електронної пошти.", url: "Будь ласка, введіть коректний URL.", date: "Будь ласка, введіть коректну дату.", dateISO: "Будь ласка, введіть коректну дату у форматі ISO.", number: "Будь ласка, введіть число.", digits: "Вводите потрібно лише цифри.", creditcard: "Будь ласка, введіть правильний номер кредитної карти.", equalTo: "Будь ласка, введіть таке ж значення ще раз.", extension: "Будь ласка, виберіть файл з правильним розширенням.", maxlength: $.validator.format("Будь ласка, введіть не більше {0} символів."), minlength: $.validator.format("Будь ласка, введіть не менше {0} символів."), rangelength: $.validator.format("Будь ласка, введіть значення довжиною від {0} до {1} символів."), range: $.validator.format("Будь ласка, введіть число від {0} до {1}."), max: $.validator.format("Будь ласка, введіть число, менше або рівно {0}."), min: $.validator.format("Будь ласка, введіть число, більше або рівно {0}.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_vi.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: VI (Vietnamese; Tiếng Việt) */ $.extend($.validator.messages, { required: "Hãy nhập.", remote: "Hãy sửa cho đúng.", email: "Hãy nhập email.", url: "Hãy nhập URL.", date: "Hãy nhập ngày.", dateISO: "Hãy nhập ngày (ISO).", number: "Hãy nhập số.", digits: "Hãy nhập chữ số.", creditcard: "Hãy nhập số thẻ tín dụng.", equalTo: "Hãy nhập thêm lần nữa.", extension: "Phần mở rộng không đúng.", maxlength: $.validator.format("Hãy nhập từ {0} kí tự trở xuống."), minlength: $.validator.format("Hãy nhập từ {0} kí tự trở lên."), rangelength: $.validator.format("Hãy nhập từ {0} đến {1} kí tự."), range: $.validator.format("Hãy nhập từ {0} đến {1}."), max: $.validator.format("Hãy nhập từ {0} trở xuống."), min: $.validator.format("Hãy nhập từ {1} trở lên.") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_zh.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: ZH (Chinese, 中文 (Zhōngwén), 汉语, 漢語) */ $.extend($.validator.messages, { required: "这是必填字段", remote: "请修正此字段", email: "请输入有效的电子邮件地址", url: "请输入有效的网址", date: "请输入有效的日期", dateISO: "请输入有效的日期 (YYYY-MM-DD)", number: "请输入有效的数字", digits: "只能输入数字", creditcard: "请输入有效的信用卡号码", equalTo: "你的输入不相同", extension: "请输入有效的后缀", maxlength: $.validator.format("最多可以输入 {0} 个字符"), minlength: $.validator.format("最少要输入 {0} 个字符"), rangelength: $.validator.format("请输入长度在 {0} 到 {1} 之间的字符串"), range: $.validator.format("请输入范围在 {0} 到 {1} 之间的数值"), max: $.validator.format("请输入不大于 {0} 的数值"), min: $.validator.format("请输入不小于 {0} 的数值") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/messages_zh_TW.js ================================================ /* * Translated default messages for the jQuery validation plugin. * Locale: ZH (Chinese; 中文 (Zhōngwén), 汉语, 漢語) * Region: TW (Taiwan) */ $.extend($.validator.messages, { required: "必須填寫", remote: "請修正此欄位", email: "請輸入有效的電子郵件", url: "請輸入有效的網址", date: "請輸入有效的日期", dateISO: "請輸入有效的日期 (YYYY-MM-DD)", number: "請輸入正確的數值", digits: "只可輸入數字", creditcard: "請輸入有效的信用卡號碼", equalTo: "請重複輸入一次", extension: "請輸入有效的後綴", maxlength: $.validator.format("最多 {0} 個字"), minlength: $.validator.format("最少 {0} 個字"), rangelength: $.validator.format("請輸入長度為 {0} 至 {1} 之間的字串"), range: $.validator.format("請輸入 {0} 至 {1} 之間的數值"), max: $.validator.format("請輸入不大於 {0} 的數值"), min: $.validator.format("請輸入不小於 {0} 的數值") }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/methods_de.js ================================================ /* * Localized default methods for the jQuery validation plugin. * Locale: DE */ $.extend($.validator.methods, { date: function(value, element) { return this.optional(element) || /^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value); }, number: function(value, element) { return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value); } }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/methods_es_CL.js ================================================ /* * Localized default methods for the jQuery validation plugin. * Locale: ES_CL */ $.extend($.validator.methods, { date: function(value, element) { return this.optional(element) || /^\d\d?\-\d\d?\-\d\d\d?\d?$/.test(value); }, number: function(value, element) { return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value); } }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/methods_fi.js ================================================ /* * Localized default methods for the jQuery validation plugin. * Locale: FI */ $.extend($.validator.methods, { date: function(value, element) { return this.optional(element) || /^\d{1,2}\.\d{1,2}\.\d{4}$/.test(value); }, number: function(value, element) { return this.optional(element) || /^-?(?:\d+)(?:,\d+)?$/.test(value); } }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/methods_nl.js ================================================ /* * Localized default methods for the jQuery validation plugin. * Locale: NL */ $.extend($.validator.methods, { date: function(value, element) { return this.optional(element) || /^\d\d?[\.\/\-]\d\d?[\.\/\-]\d\d\d?\d?$/.test(value); } }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/src/localization/methods_pt.js ================================================ /* * Localized default methods for the jQuery validation plugin. * Locale: PT_BR */ $.extend($.validator.methods, { date: function(value, element) { return this.optional(element) || /^\d\d?\/\d\d?\/\d\d\d?\d?$/.test(value); } }); ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation/validation.jquery.json ================================================ { "name": "validation", "title": "jQuery Validation", "description": "Form validation made easy. Validate a simple comment form with inline rules, or a complex signup form with powerful remote checks.", "keywords": [ "forms", "validation", "validate" ], "author": { "name": "Jörn Zaefferer", "email": "joern.zaefferer@gmail.com", "url": "http://bassistance.de" }, "licenses": [ { "type": "MIT", "url": "http://www.opensource.org/licenses/MIT" } ], "bugs": "https://github.com/jzaefferer/jquery-validation/issues", "homepage": "https://github.com/jzaefferer/jquery-validation", "docs": "http://jqueryvalidation.org/documentation/", "download": "https://github.com/jzaefferer/jquery-validation/releases", "dependencies": { "jquery": ">=1.4.4" }, "version": "1.14.0" } ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation-unobtrusive/.bower.json ================================================ { "name": "jquery-validation-unobtrusive", "version": "3.2.6", "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", "main": [ "jquery.validate.unobtrusive.js" ], "ignore": [ "**/.*", "*.json", "*.md", "*.txt", "!LICENSE.txt", "gulpfile.js" ], "keywords": [ "jquery", "asp.net", "mvc", "validation", "unobtrusive" ], "authors": [ "Microsoft" ], "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", "repository": { "type": "git", "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" }, "dependencies": { "jquery-validation": ">=1.8", "jquery": ">=1.8" }, "_release": "3.2.6", "_resolution": { "type": "version", "tag": "v3.2.6", "commit": "47e82bc6cb86a05247f8c3846192228038572783" }, "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", "_target": "3.2.6", "_originalSource": "jquery-validation-unobtrusive" } ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt ================================================ Copyright (c) .NET Foundation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation-unobtrusive/bower.json ================================================ { "name": "jquery-validation-unobtrusive", "version": "3.2.6", "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", "main": [ "jquery.validate.unobtrusive.js" ], "ignore": [ "**/.*", "*.json", "*.md", "*.txt", "!LICENSE.txt", "gulpfile.js" ], "keywords": [ "jquery", "asp.net", "mvc", "validation", "unobtrusive" ], "authors": [ "Microsoft" ], "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", "repository": { "type": "git", "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" }, "dependencies": { "jquery-validation": ">=1.8", "jquery": ">=1.8" } } ================================================ FILE: Blog.IdentityServer/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js ================================================ /*! ** Unobtrusive validation support library for jQuery and jQuery Validate ** Copyright (C) Microsoft Corporation. All rights reserved. */ /*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ /*global document: false, jQuery: false */ (function ($) { var $jQval = $.validator, adapters, data_validation = "unobtrusiveValidation"; function setValidationValues(options, ruleName, value) { options.rules[ruleName] = value; if (options.message) { options.messages[ruleName] = options.message; } } function splitAndTrim(value) { return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g); } function escapeAttributeValue(value) { // As mentioned on http://api.jquery.com/category/selectors/ return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1"); } function getModelPrefix(fieldName) { return fieldName.substr(0, fieldName.lastIndexOf(".") + 1); } function appendModelPrefix(value, prefix) { if (value.indexOf("*.") === 0) { value = value.replace("*.", prefix); } return value; } function onError(error, inputElement) { // 'this' is the form element var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"), replaceAttrValue = container.attr("data-valmsg-replace"), replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null; container.removeClass("field-validation-valid").addClass("field-validation-error"); error.data("unobtrusiveContainer", container); if (replace) { container.empty(); error.removeClass("input-validation-error").appendTo(container); } else { error.hide(); } } function onErrors(event, validator) { // 'this' is the form element var container = $(this).find("[data-valmsg-summary=true]"), list = container.find("ul"); if (list && list.length && validator.errorList.length) { list.empty(); container.addClass("validation-summary-errors").removeClass("validation-summary-valid"); $.each(validator.errorList, function () { $("
  • ").html(this.message).appendTo(list); }); } } function onSuccess(error) { // 'this' is the form element var container = error.data("unobtrusiveContainer"); if (container) { var replaceAttrValue = container.attr("data-valmsg-replace"), replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null; container.addClass("field-validation-valid").removeClass("field-validation-error"); error.removeData("unobtrusiveContainer"); if (replace) { container.empty(); } } } function onReset(event) { // 'this' is the form element var $form = $(this), key = '__jquery_unobtrusive_validation_form_reset'; if ($form.data(key)) { return; } // Set a flag that indicates we're currently resetting the form. $form.data(key, true); try { $form.data("validator").resetForm(); } finally { $form.removeData(key); } $form.find(".validation-summary-errors") .addClass("validation-summary-valid") .removeClass("validation-summary-errors"); $form.find(".field-validation-error") .addClass("field-validation-valid") .removeClass("field-validation-error") .removeData("unobtrusiveContainer") .find(">*") // If we were using valmsg-replace, get the underlying error .removeData("unobtrusiveContainer"); } function validationInfo(form) { var $form = $(form), result = $form.data(data_validation), onResetProxy = $.proxy(onReset, form), defaultOptions = $jQval.unobtrusive.options || {}, execInContext = function (name, args) { var func = defaultOptions[name]; func && $.isFunction(func) && func.apply(form, args); } if (!result) { result = { options: { // options structure passed to jQuery Validate's validate() method errorClass: defaultOptions.errorClass || "input-validation-error", errorElement: defaultOptions.errorElement || "span", errorPlacement: function () { onError.apply(form, arguments); execInContext("errorPlacement", arguments); }, invalidHandler: function () { onErrors.apply(form, arguments); execInContext("invalidHandler", arguments); }, messages: {}, rules: {}, success: function () { onSuccess.apply(form, arguments); execInContext("success", arguments); } }, attachValidation: function () { $form .off("reset." + data_validation, onResetProxy) .on("reset." + data_validation, onResetProxy) .validate(this.options); }, validate: function () { // a validation function that is called by unobtrusive Ajax $form.validate(); return $form.valid(); } }; $form.data(data_validation, result); } return result; } $jQval.unobtrusive = { adapters: [], parseElement: function (element, skipAttach) { /// /// Parses a single HTML element for unobtrusive validation attributes. /// /// The HTML element to be parsed. /// [Optional] true to skip attaching the /// validation to the form. If parsing just this single element, you should specify true. /// If parsing several elements, you should specify false, and manually attach the validation /// to the form when you are finished. The default is false. var $element = $(element), form = $element.parents("form")[0], valInfo, rules, messages; if (!form) { // Cannot do client-side validation without a form return; } valInfo = validationInfo(form); valInfo.options.rules[element.name] = rules = {}; valInfo.options.messages[element.name] = messages = {}; $.each(this.adapters, function () { var prefix = "data-val-" + this.name, message = $element.attr(prefix), paramValues = {}; if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy) prefix += "-"; $.each(this.params, function () { paramValues[this] = $element.attr(prefix + this); }); this.adapt({ element: element, form: form, message: message, params: paramValues, rules: rules, messages: messages }); } }); $.extend(rules, { "__dummy__": true }); if (!skipAttach) { valInfo.attachValidation(); } }, parse: function (selector) { /// /// Parses all the HTML elements in the specified selector. It looks for input elements decorated /// with the [data-val=true] attribute value and enables validation according to the data-val-* /// attribute values. /// /// Any valid jQuery selector. // $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one // element with data-val=true var $selector = $(selector), $forms = $selector.parents() .addBack() .filter("form") .add($selector.find("form")) .has("[data-val=true]"); $selector.find("[data-val=true]").each(function () { $jQval.unobtrusive.parseElement(this, true); }); $forms.each(function () { var info = validationInfo(this); if (info) { info.attachValidation(); } }); } }; adapters = $jQval.unobtrusive.adapters; adapters.add = function (adapterName, params, fn) { /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation. /// The name of the adapter to be added. This matches the name used /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). /// [Optional] An array of parameter names (strings) that will /// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and /// mmmm is the parameter name). /// The function to call, which adapts the values from the HTML /// attributes into jQuery Validate rules and/or messages. /// if (!fn) { // Called with no params, just a function fn = params; params = []; } this.push({ name: adapterName, params: params, adapt: fn }); return this; }; adapters.addBool = function (adapterName, ruleName) { /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where /// the jQuery Validate validation rule has no parameter values. /// The name of the adapter to be added. This matches the name used /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). /// [Optional] The name of the jQuery Validate rule. If not provided, the value /// of adapterName will be used instead. /// return this.add(adapterName, function (options) { setValidationValues(options, ruleName || adapterName, true); }); }; adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) { /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where /// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and /// one for min-and-max). The HTML parameters are expected to be named -min and -max. /// The name of the adapter to be added. This matches the name used /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name). /// The name of the jQuery Validate rule to be used when you only /// have a minimum value. /// The name of the jQuery Validate rule to be used when you only /// have a maximum value. /// The name of the jQuery Validate rule to be used when you /// have both a minimum and maximum value. /// [Optional] The name of the HTML attribute that /// contains the minimum value. The default is "min". /// [Optional] The name of the HTML attribute that /// contains the maximum value. The default is "max". /// return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) { var min = options.params.min, max = options.params.max; if (min && max) { setValidationValues(options, minMaxRuleName, [min, max]); } else if (min) { setValidationValues(options, minRuleName, min); } else if (max) { setValidationValues(options, maxRuleName, max); } }); }; adapters.addSingleVal = function (adapterName, attribute, ruleName) { /// Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where /// the jQuery Validate validation rule has a single value. /// The name of the adapter to be added. This matches the name used /// in the data-val-nnnn HTML attribute(where nnnn is the adapter name). /// [Optional] The name of the HTML attribute that contains the value. /// The default is "val". /// [Optional] The name of the jQuery Validate rule. If not provided, the value /// of adapterName will be used instead. /// return this.add(adapterName, [attribute || "val"], function (options) { setValidationValues(options, ruleName || adapterName, options.params[attribute]); }); }; $jQval.addMethod("__dummy__", function (value, element, params) { return true; }); $jQval.addMethod("regex", function (value, element, params) { var match; if (this.optional(element)) { return true; } match = new RegExp(params).exec(value); return (match && (match.index === 0) && (match[0].length === value.length)); }); $jQval.addMethod("nonalphamin", function (value, element, nonalphamin) { var match; if (nonalphamin) { match = value.match(/\W/g); match = match && match.length >= nonalphamin; } return match; }); if ($jQval.methods.extension) { adapters.addSingleVal("accept", "mimtype"); adapters.addSingleVal("extension", "extension"); } else { // for backward compatibility, when the 'extension' validation method does not exist, such as with versions // of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for // validating the extension, and ignore mime-type validations as they are not supported. adapters.addSingleVal("extension", "extension", "accept"); } adapters.addSingleVal("regex", "pattern"); adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"); adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range"); adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength"); adapters.add("equalto", ["other"], function (options) { var prefix = getModelPrefix(options.element.name), other = options.params.other, fullOtherName = appendModelPrefix(other, prefix), element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0]; setValidationValues(options, "equalTo", element); }); adapters.add("required", function (options) { // jQuery Validate equates "required" with "mandatory" for checkbox elements if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") { setValidationValues(options, "required", true); } }); adapters.add("remote", ["url", "type", "additionalfields"], function (options) { var value = { url: options.params.url, type: options.params.type || "GET", data: {} }, prefix = getModelPrefix(options.element.name); $.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) { var paramName = appendModelPrefix(fieldName, prefix); value.data[paramName] = function () { var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']"); // For checkboxes and radio buttons, only pick up values from checked fields. if (field.is(":checkbox")) { return field.filter(":checked").val() || field.filter(":hidden").val() || ''; } else if (field.is(":radio")) { return field.filter(":checked").val() || ''; } return field.val(); }; }); setValidationValues(options, "remote", value); }); adapters.add("password", ["min", "nonalphamin", "regex"], function (options) { if (options.params.min) { setValidationValues(options, "minlength", options.params.min); } if (options.params.nonalphamin) { setValidationValues(options, "nonalphamin", options.params.nonalphamin); } if (options.params.regex) { setValidationValues(options, "regex", options.params.regex); } }); $(function () { $jQval.unobtrusive.parse(document); }); }(jQuery)); ================================================ FILE: Blog.IdentityServer.Publish.Docker.sh ================================================ # 停止容器 docker stop idscontainer # 删除容器 docker rm idscontainer # 删除镜像 docker rmi laozhangisphi/idsimg # 切换目录 cd /home/Blog.IdentityServer # 发布项目 ./Blog.IdentityServer.Publish.Linux.sh # 进入目录 cd /home/Blog.IdentityServer/.PublishFiles/ # 编译镜像 docker build -t laozhangisphi/idsimg . # 生成容器 docker run --name=idscontainer -v /etc/localtime:/etc/localtime -it -p 5004:5004 laozhangisphi/idsimg # 启动容器 docker start idscontainer ================================================ FILE: Blog.IdentityServer.Publish.Linux.sh ================================================ git pull; rm -rf .PublishFiles; dotnet build; dotnet publish -o /home/Blog.IdentityServer/Blog.IdentityServer/bin/Debug/netcoreapp3.1; cp -r /home/Blog.IdentityServer/Blog.IdentityServer/bin/Debug/netcoreapp3.1 .PublishFiles; echo "Successfully!!!! ^ please see the file .PublishFiles"; ================================================ FILE: Blog.IdentityServer.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30427.197 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blog.IdentityServer", "Blog.IdentityServer\Blog.IdentityServer.csproj", "{1DB65298-136C-41BC-B2CD-BA5BBA3D7A23}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1DB65298-136C-41BC-B2CD-BA5BBA3D7A23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1DB65298-136C-41BC-B2CD-BA5BBA3D7A23}.Debug|Any CPU.Build.0 = Debug|Any CPU {1DB65298-136C-41BC-B2CD-BA5BBA3D7A23}.Release|Any CPU.ActiveCfg = Release|Any CPU {1DB65298-136C-41BC-B2CD-BA5BBA3D7A23}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F8CF5BB1-9EC8-44D8-94A3-0A5215DAE293} EndGlobalSection EndGlobal ================================================ FILE: Build.bat ================================================ git pull dotnet build cd Blog.IdentityServer dotnet run cmd ================================================ FILE: Dockerfile ================================================ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base WORKDIR /app EXPOSE 5004 FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build WORKDIR /src COPY ["Blog.IdentityServer/Blog.IdentityServer.csproj", "Blog.IdentityServer/"] RUN dotnet restore "Blog.IdentityServer/Blog.IdentityServer.csproj" COPY . . WORKDIR "/src/Blog.IdentityServer" RUN dotnet build "Blog.IdentityServer.csproj" -c Release -o /app/build FROM build AS publish RUN dotnet publish "Blog.IdentityServer.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "Blog.IdentityServer.dll"] ================================================ FILE: README.md ================================================  ![Logo](https://github.com/anjoy8/Blog.IdentityServer/blob/master/Blog.IdentityServer/wwwroot/logofull.png)     ## Info 1、项目支持SqlServer和Mysql,默认Mysql,在配置文件中可以设置:"IsMysql": true, 2、如果用mysql,直接执行update-database即可,迁移文件在data下的MigrationsMySql文件夹; 3、如果不想用自带的迁移文件,先删掉data下的MigrationsMySql文件夹,然后执行(具体步骤在SeedData.cs中); ## 给个星星! ⭐️ 如果你喜欢这个项目或者它帮助你, 请给 Star~(辛苦星咯) ********************************************************* ## 售后服务与支持 鼓励作者,简单打赏,入微信群,随时随地解答我框架中(NetCore、Vue、DDD、IdentityServer4等)的疑难杂症。 注意主要是帮忙解决bug和思路,不会远程授课,但是可以适当发我代码,我帮忙调试, 打赏的时候,备注自己的微信号,我拉你进群,两天内没回应,QQ私聊我(3143422472); [赞赏列表](http://apk.neters.club/.doc/Contribution/) 赞赏码 [图片若加载不出来,点这里](http://apk.neters.club/laozhangisphigood.jpg) ## Tips: ``` /* * 本项目同时支持Mysql和Sqlserver,我一直使用的是Mysql,所以Mysql的迁移文件已经配置好,在Data文件夹下, * 直接执行update-database xxxx,那三步即可。如果你使用sqlserver,可以先从迁移开始,下边有步骤 * * 当然你也可以把Data文件夹除了ApplicationDbContext.cs文件外都删掉,自己重新做迁移。 * 迁移完成后,执行dotnet run /seed * 1、PM> add-migration InitialIdentityServerPersistedGrantDbMigrationMysql -c PersistedGrantDbContext -o Data/MigrationsMySql/IdentityServer/PersistedGrantDb Build started... Build succeeded. To undo this action, use Remove-Migration. 2、PM> update-database -c PersistedGrantDbContext Build started... Build succeeded. Applying migration '20200509165052_InitialIdentityServerPersistedGrantDbMigrationMysql'. Done. 3、PM> add-migration InitialIdentityServerConfigurationDbMigrationMysql -c ConfigurationDbContext -o Data/MigrationsMySql/IdentityServer/ConfigurationDb Build started... Build succeeded. To undo this action, use Remove-Migration. 4、PM> update-database -c ConfigurationDbContext Build started... Build succeeded. Applying migration '20200509165153_InitialIdentityServerConfigurationDbMigrationMysql'. Done. 5、PM> add-migration AppDbMigration -c ApplicationDbContext -o Data/MigrationsMySql Build started... Build succeeded. To undo this action, use Remove-Migration. 6、PM> update-database -c ApplicationDbContext Build started... Build succeeded. Applying migration '20200509165505_AppDbMigration'. Done. * */ ``` ***************************************************** ### 跟踪教程 博客园:https://www.cnblogs.com/laozhang-is-phi/ 视频:https://www.bilibili.com/video/av76828468 微信公众号:https://mvp.neters.club/MVP_ids4_2020/2020 ``` ``` ************************************************************** 技术: * .Net Core 3.1 MVC * EntityFramework Core * SqlServer/Mysql * IdentityServer4 * Authentication and Authorization * OAuth2 and OpenId Connect * GrantTypes.Implicit * oidc-client