java.lang.Object
org.miaixz.bus.auth.nimble.AbstractProvider
org.miaixz.bus.auth.nimble.eleme.ElemeProvider
- All Implemented Interfaces:
Provider,org.miaixz.bus.core.Provider
饿了么 登录
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields inherited from class org.miaixz.bus.auth.nimble.AbstractProvider
cache, complex, context -
Constructor Summary
ConstructorsConstructorDescriptionElemeProvider(Context context) ElemeProvider(Context context, org.miaixz.bus.cache.metric.ExtendCache cache) -
Method Summary
Modifier and TypeMethodDescription生成用于启动认证流程的授权 URL。getAccessToken(Callback callback) 获取access tokengetUserInfo(AccToken accToken) 使用token换取用户信息org.miaixz.bus.core.basic.entity.Message刷新access token (续期)static Stringsign(String appKey, String secret, long timestamp, String action, String token, Map<String, Object> parameters) 生成饿了么请求的签名Methods inherited from class org.miaixz.bus.auth.nimble.AbstractProvider
accessTokenUrl, check, check, doGetAuthorizationCode, doGetRevoke, doGetUserInfo, doPostAuthorizationCode, getDefaultScopes, getRealState, getScopes, getScopes, login, refreshTokenUrl, responseError, revokeUrl, userInfoUrl
-
Constructor Details
-
ElemeProvider
-
ElemeProvider
-
-
Method Details
-
sign
public static String sign(String appKey, String secret, long timestamp, String action, String token, Map<String, Object> parameters) 生成饿了么请求的签名- Parameters:
appKey- 平台应用的授权keysecret- 平台应用的授权密钥timestamp- 时间戳,单位秒。API服务端允许客户端请求最大时间误差为正负5分钟。action- 饿了么请求的api方法token- 用户授权的tokenparameters- 加密参数- Returns:
- Signature
-
getAccessToken
Description copied from interface:Provider获取access token- Parameters:
callback- 授权成功后的回调参数- Returns:
- token
- See Also:
-
refresh
Description copied from interface:Provider刷新access token (续期)- Parameters:
oldToken- 登录成功后返回的Token信息- Returns:
- Message
-
getUserInfo
Description copied from interface:Provider使用token换取用户信息- Parameters:
accToken- token信息- Returns:
- 用户信息
- See Also:
-
authorize
Description copied from class:AbstractProvider生成用于启动认证流程的授权 URL。- Specified by:
authorizein interfaceProvider- Overrides:
authorizein classAbstractProvider- Parameters:
state- 用于防止 CSRF 攻击的状态参数- Returns:
- 授权 URL,对于 LDAP 等协议返回 null
-