jsonwebtoken.github.io
Extensions - 2.1.3
如果您想在项目中快速添加基于令牌的身份验证(JSON Web),请随时查看Auth0的文档和免费计划。 |
要添加库,只需编辑位于views/website/libraries
中的右JSON文件即可。每种语言都有自己的文件。多个库共享相同的语言文件。
要添加一种新语言,只需在与其他文件的同一文件夹中添加一个JSON文件。它将自动识别。如果添加新语言,则需要为其提供适当的图标并将其放在img
文件夹中。
这是.NET语言文件( 0-.NET.json
)的评论示例。除非指出:所有字段必须具有有效的值:
{
// Language name (unique)
"name" : ".NET" ,
// Unique identifier that will be used as a CSS class
// for this language (only valid CSS class names).
"uniqueClass" : "net" ,
// The language icon, SVG format preferred, should be placed
// in /img directory.
"image" : "/img/1.svg" ,
// The color of header that displays the name of the language
// and the icon. This is a valid CSS color definition.
"bgColor" : "rgb(42, 168, 229)" ,
// An array of libraries for this language.
"libs" : [
{
// In case the library suffered from a vulnerability, the
// minimum version in which the vuln was fixed must be
// listed here. Optional (can be null).
"minimumVersion" : "1.0.1" , // or null
// Supported features, true for supported,
// false for not supported.
"support" : {
"sign" : true ,
"verify" : true ,
"iss" : true ,
"sub" : true ,
"aud" : true ,
"exp" : true ,
"nbf" : true ,
"iat" : true ,
"jti" : true ,
"hs256" : true ,
"hs384" : true ,
"hs512" : true ,
"rs256" : true ,
"rs384" : true ,
"rs512" : true ,
"es256" : true ,
"es384" : true ,
"es512" : true ,
"ps256" : true ,
"ps384" : true ,
"ps512" : true ,
"eddsa" : true
} ,
// Author URL, can be GitHub profile, personal page
// company page, etc. Can be null.
"authorUrl" : "https://www.microsoft.com" , // or null
// Author name.
"authorName" : "Microsoft" ,
// For the star count, this is the GitHub repository path,
// (usually user/repo). Can be null (no star count shown).
"gitHubRepoPath" : "AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet" , // or null
// URL for source code.
"repoUrl" : "https://github.com/MSOpenTech/azure-activedirectory-identitymodel-extensions-for-dotnet" ,
// Install command, can be HTML or plain text.
"installCommandHtml" : "Install-Package<br><a href="https://www.nuget.org/packages/System.IdentityModel.Tokens.Jwt/">System.IdentityModel.Tokens.Jwt</a>"
}
]
}
首先,安装所需的依赖项:
npm install
为了构建(并运行)项目执行:
./node_modules/.bin/grunt
您将在dist
目录中找到生成的文件。对于网站,您可以以其词根运行服务器。例如: http-server dist/website
。默认的grunt
任务通过https://127.0.0.1:8000运行服务器,并观看更改。
要运行测试,请执行:
./node_modules/.bin/grunt test
查看Gruntfile的末尾查看其他常见任务。