public class YfyEnterpriseAuth extends Object
| Constructor and Description |
|---|
YfyEnterpriseAuth(YfyRequestConfig requestConfig,
String kid,
Key key)
Creates a new instance that will perform the OAuth2 jwt flow using the given OAuth
request configuration.
|
| Modifier and Type | Method and Description |
|---|---|
YfyAuthFinish |
getEnterpriseToken(long enterpriseId)
Get the enterprise token witch can used to invoke admin api,such as managing departments and groups
|
YfyAuthFinish |
getEnterpriseToken(long enterpriseId,
int expirationTimeSeconds)
Get the enterprise token witch can used to invoke admin api,such as managing departments and groups
|
YfyAuthFinish |
getUserToken(long userId)
Get the user token witch can used to invoke personal api,such as get folder information
|
YfyAuthFinish |
getUserToken(long userId,
int expirationTimeSeconds)
Get the user token witch can used to invoke personal api,such as get folder information
|
static PrivateKey |
loadPrivateKey(InputStream fileStream)
Load private pkcs8 pem file to get the private key
|
public YfyEnterpriseAuth(YfyRequestConfig requestConfig, String kid, Key key)
requestConfig - HTTP request configuration, never null.public YfyAuthFinish getEnterpriseToken(long enterpriseId, int expirationTimeSeconds) throws YfyException
enterpriseId - Your enterprise idexpirationTimeSeconds - Expiration time seconds in the future(can not be bigger than 60)YfyExceptionpublic YfyAuthFinish getEnterpriseToken(long enterpriseId) throws YfyException
enterpriseId - Your enterprise idYfyExceptionpublic YfyAuthFinish getUserToken(long userId, int expirationTimeSeconds) throws YfyException
userId - The user you want to operate withexpirationTimeSeconds - Expiration time seconds in the future(can not be bigger than 60)YfyExceptionpublic YfyAuthFinish getUserToken(long userId) throws YfyException
userId - The user you want to operate withYfyExceptionpublic static PrivateKey loadPrivateKey(InputStream fileStream) throws Exception
fileStream - InputStream of the Pkcs8 fileExceptionCopyright © 2018 YiFangYun. All rights reserved.