C# 클래스 com.microsoft.dx.officewopi.Security.WopiSecurity

Class handles token generation and validation for the WOPI host
파일 보기 프로젝트 열기: OfficeDev/PnP-WOPI 1 사용 예제들

공개 메소드들

메소드 설명
GenerateToken ( string user, string container, string docId ) : System.IdentityModel.Tokens.JwtSecurityToken

Generates an access token for the user and file

GetUserFromToken ( string tokenString ) : string

Extracts the user information from a provided access token

ValidateToken ( string tokenString, string container, string docId ) : bool

Generates an access token specific to a user and file

WriteToken ( System.IdentityModel.Tokens.JwtSecurityToken token ) : string

Converts the JwtSecurityToken to a Base64 string that can be used by the Host

비공개 메소드들

메소드 설명
getCert ( ) : X509Certificate2

Gets the self-signed certificate used to sign the access tokens

메소드 상세

GenerateToken() 공개 메소드

Generates an access token for the user and file
public GenerateToken ( string user, string container, string docId ) : System.IdentityModel.Tokens.JwtSecurityToken
user string
container string
docId string
리턴 System.IdentityModel.Tokens.JwtSecurityToken

GetUserFromToken() 공개 정적인 메소드

Extracts the user information from a provided access token
public static GetUserFromToken ( string tokenString ) : string
tokenString string
리턴 string

ValidateToken() 공개 정적인 메소드

Generates an access token specific to a user and file
public static ValidateToken ( string tokenString, string container, string docId ) : bool
tokenString string
container string
docId string
리턴 bool

WriteToken() 공개 메소드

Converts the JwtSecurityToken to a Base64 string that can be used by the Host
public WriteToken ( System.IdentityModel.Tokens.JwtSecurityToken token ) : string
token System.IdentityModel.Tokens.JwtSecurityToken
리턴 string