C# 클래스 Box.V2.JWTAuth.BoxJWTAuth

Box’s new authentication model allows applications to authenticate directly to Box using a JSON Web Token (JWT) signed with an RSA key. This authentication method is meant for server-to-server applications and replaces the first leg of the standard 3-legged OAuth 2.0 process in which users grant an application authorization to access their Box account.
https://docs.box.com/docs/getting-started-box-platform
파일 보기 프로젝트 열기: box/box-windows-sdk-v2 1 사용 예제들

공개 메소드들

메소드 설명
AdminClient ( string adminToken, string asUser = null, bool suppressNotifications = null ) : BoxClient

Create admin BoxClient using an admin access token

AdminToken ( ) : string

Get admin token by posting data to auth url

BoxJWTAuth ( IBoxConfig boxConfig ) : Box.V2.Auth

Constructor for JWT authentication

Session ( string token ) : OAuthSession

Create OAuth session from token

UserClient ( string userToken, string userId ) : BoxClient

Create user BoxClient using a user access token

UserToken ( string userId ) : string

Once you have created an App User, you can request a User Access Token via the App Auth feature, which will return the OAuth 2.0 access token for the specified App User.

비공개 메소드들

메소드 설명
ConstructJWTAssertion ( string sub, string boxSubType ) : string
JWTAuthPost ( string assertion ) : OAuthSession

메소드 상세

AdminClient() 공개 메소드

Create admin BoxClient using an admin access token
public AdminClient ( string adminToken, string asUser = null, bool suppressNotifications = null ) : BoxClient
adminToken string Admin access token
asUser string The user ID to set as the 'As-User' header parameter; used to make calls in the context of a user using an admin token
suppressNotifications bool Whether or not to suppress both email and webhook notifications. Typically used for administrative API calls. Your application must have “Manage an Enterprise” scope, and the user making the API calls is a co-admin with the correct "Edit settings for your company" permission.
리턴 BoxClient

AdminToken() 공개 메소드

Get admin token by posting data to auth url
public AdminToken ( ) : string
리턴 string

BoxJWTAuth() 공개 메소드

Constructor for JWT authentication
public BoxJWTAuth ( IBoxConfig boxConfig ) : Box.V2.Auth
boxConfig IBoxConfig Config contains information about client id, client secret, enterprise id, private key, private key password, public key id
리턴 Box.V2.Auth

Session() 공개 메소드

Create OAuth session from token
public Session ( string token ) : OAuthSession
token string Access token created by method UserToken, or AdminToken
리턴 Box.V2.Auth.OAuthSession

UserClient() 공개 메소드

Create user BoxClient using a user access token
public UserClient ( string userToken, string userId ) : BoxClient
userToken string User access token
userId string Id of the user
리턴 BoxClient

UserToken() 공개 메소드

Once you have created an App User, you can request a User Access Token via the App Auth feature, which will return the OAuth 2.0 access token for the specified App User.
public UserToken ( string userId ) : string
userId string Id of the user
리턴 string