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的末尾查看其他常見任務。