本文整理汇总了Java中net.openid.appauth.AuthorizationServiceDiscovery类的典型用法代码示例。如果您正苦于以下问题:Java AuthorizationServiceDiscovery类的具体用法?Java AuthorizationServiceDiscovery怎么用?Java AuthorizationServiceDiscovery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AuthorizationServiceDiscovery类属于net.openid.appauth包,在下文中一共展示了AuthorizationServiceDiscovery类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createPostAuthorizationIntent
import net.openid.appauth.AuthorizationServiceDiscovery; //导入依赖的package包/类
static PendingIntent createPostAuthorizationIntent(
@NonNull Context context,
@NonNull AuthorizationRequest request,
@Nullable AuthorizationServiceDiscovery discoveryDoc,
@Nullable String clientSecret) {
Intent intent = new Intent(context, TokenActivity.class);
if (discoveryDoc != null) {
intent.putExtra(EXTRA_AUTH_SERVICE_DISCOVERY, discoveryDoc.docJson.toString());
}
if (clientSecret != null) {
intent.putExtra(EXTRA_CLIENT_SECRET, clientSecret);
}
return PendingIntent.getActivity(context, request.hashCode(), intent, 0);
}
开发者ID:iainmcgin,项目名称:AppAuth-Demo,代码行数:17,代码来源:TokenActivity.java
示例2: finishServiceDiscovery
import net.openid.appauth.AuthorizationServiceDiscovery; //导入依赖的package包/类
private void finishServiceDiscovery(AuthorizationServiceConfiguration config,
AuthorizationException ex) {
if (config == null) {
failLogin(new AuthException("Failed to retrieve authorization service discovery document"));
return;
}
authState = new AuthState(config);
AuthorizationServiceDiscovery discovery = config.discoveryDoc;
userInfoUrl = discovery.getUserinfoEndpoint().toString();
loginListener.onEvent(AuthRepo.this, AUTH_SERVICE_DISCOVERY_FINISH);
finishServiceConfig();
}
开发者ID:approov,项目名称:AppAuth-OAuth2-Books-Demo,代码行数:16,代码来源:AuthRepo.java
示例3: getDiscoveryDocFromIntent
import net.openid.appauth.AuthorizationServiceDiscovery; //导入依赖的package包/类
static AuthorizationServiceDiscovery getDiscoveryDocFromIntent(Intent intent) {
if (!intent.hasExtra(EXTRA_AUTH_SERVICE_DISCOVERY)) {
return null;
}
String discoveryJson = intent.getStringExtra(EXTRA_AUTH_SERVICE_DISCOVERY);
try {
return new AuthorizationServiceDiscovery(new JSONObject(discoveryJson));
} catch (JSONException | AuthorizationServiceDiscovery.MissingArgumentException ex) {
throw new IllegalStateException("Malformed JSON in discovery doc");
}
}
开发者ID:iainmcgin,项目名称:AppAuth-Demo,代码行数:12,代码来源:TokenActivity.java
示例4: createPostAuthorizationIntent
import net.openid.appauth.AuthorizationServiceDiscovery; //导入依赖的package包/类
private PendingIntent createPostAuthorizationIntent(
@NonNull Context context,
@NonNull AuthorizationRequest request,
@Nullable AuthorizationServiceDiscovery discoveryDoc) {
Intent intent = new Intent(context, this.getClass());
if (discoveryDoc != null) {
intent.putExtra(EXTRA_AUTH_SERVICE_DISCOVERY, discoveryDoc.docJson.toString());
}
return PendingIntent.getActivity(context, request.hashCode(), intent, 0);
}
开发者ID:pingidentity,项目名称:Android-AppAuth-Sample-Application,代码行数:13,代码来源:MainActivity.java
示例5: getDiscoveryDocFromIntent
import net.openid.appauth.AuthorizationServiceDiscovery; //导入依赖的package包/类
private AuthorizationServiceDiscovery getDiscoveryDocFromIntent(Intent intent) {
if (!intent.hasExtra(EXTRA_AUTH_SERVICE_DISCOVERY)) {
return null;
}
String discoveryJson = intent.getStringExtra(EXTRA_AUTH_SERVICE_DISCOVERY);
try {
return new AuthorizationServiceDiscovery(new JSONObject(discoveryJson));
} catch (JSONException | AuthorizationServiceDiscovery.MissingArgumentException ex) {
throw new IllegalStateException("Malformed JSON in discovery doc");
}
}
开发者ID:pingidentity,项目名称:Android-AppAuth-Sample-Application,代码行数:12,代码来源:MainActivity.java
示例6: createPostAuthorizationIntent
import net.openid.appauth.AuthorizationServiceDiscovery; //导入依赖的package包/类
/**
* Starts webView intent
*
*/
static PendingIntent createPostAuthorizationIntent(
@NonNull Context context,
@NonNull AuthorizationRequest request,
@Nullable AuthorizationServiceDiscovery discoveryDoc
) {
Intent intent = new Intent(context, OktaAppAuth.class);
intent.putExtra(EXTRA_AUTH_STATE, discoveryDoc.docJson.toString());
if (discoveryDoc != null) {
intent.putExtra(EXTRA_AUTH_SERVICE_DISCOVERY, discoveryDoc.docJson.toString());
}
return PendingIntent.getActivity(context, request.hashCode(), intent, 0);
}
开发者ID:oktadeveloper,项目名称:okta-openidconnect-appauth-android,代码行数:18,代码来源:OktaAppAuth.java
示例7: getDiscoveryDocFromIntent
import net.openid.appauth.AuthorizationServiceDiscovery; //导入依赖的package包/类
/**
* Gets endpoints from configured domain
*
* @param intent: Browser intent
* @return
*/
static AuthorizationServiceDiscovery getDiscoveryDocFromIntent(Intent intent) {
if (!intent.hasExtra(EXTRA_AUTH_SERVICE_DISCOVERY)) {
return null;
}
String discoveryJson = intent.getStringExtra(EXTRA_AUTH_SERVICE_DISCOVERY);
try {
return new AuthorizationServiceDiscovery(new JSONObject(discoveryJson));
} catch (JSONException | AuthorizationServiceDiscovery.MissingArgumentException ex) {
throw new IllegalStateException("Malformed JSON in discovery doc");
}
}
开发者ID:oktadeveloper,项目名称:okta-openidconnect-appauth-android,代码行数:18,代码来源:OktaAppAuth.java
示例8: createPostAuthorizationIntent
import net.openid.appauth.AuthorizationServiceDiscovery; //导入依赖的package包/类
static PendingIntent createPostAuthorizationIntent(
@NonNull Context context,
@NonNull AuthorizationRequest request,
@Nullable AuthorizationServiceDiscovery discoveryDoc,
@NonNull AuthState authState) {
Intent intent = new Intent(context, OpenIDAppAuthTokenActivity.class);
intent.putExtra(EXTRA_AUTH_STATE, authState.jsonSerializeString());
if (discoveryDoc != null) {
intent.putExtra(EXTRA_AUTH_SERVICE_DISCOVERY, discoveryDoc.docJson.toString());
}
return PendingIntent.getActivity(context, request.hashCode(), intent, PendingIntent.FLAG_UPDATE_CURRENT);
}
开发者ID:janrain,项目名称:jump.android,代码行数:13,代码来源:OpenIDAppAuthTokenActivity.java
示例9: fetchUserInfo
import net.openid.appauth.AuthorizationServiceDiscovery; //导入依赖的package包/类
@MainThread
private void fetchUserInfo(String accessToken, String idToken, AuthorizationException ex) {
if (ex != null) {
Log.e(TAG, "Token refresh failed when fetching user info");
mUserInfoJson.set(null);
runOnUiThread(this::displayAuthorized);
return;
}
AuthorizationServiceDiscovery discovery =
mStateManager.getCurrent()
.getAuthorizationServiceConfiguration()
.discoveryDoc;
URL userInfoEndpoint;
try {
userInfoEndpoint = new URL(discovery.getUserinfoEndpoint().toString());
} catch (MalformedURLException urlEx) {
Log.e(TAG, "Failed to construct user info endpoint URL", urlEx);
mUserInfoJson.set(null);
runOnUiThread(this::displayAuthorized);
return;
}
mExecutor.submit(() -> {
try {
HttpURLConnection conn =
(HttpURLConnection) userInfoEndpoint.openConnection();
conn.setRequestProperty("Authorization", "Bearer " + accessToken);
conn.setInstanceFollowRedirects(false);
String response = Okio.buffer(Okio.source(conn.getInputStream()))
.readString(Charset.forName("UTF-8"));
mUserInfoJson.set(new JSONObject(response));
} catch (IOException ioEx) {
Log.e(TAG, "Network error when querying userinfo endpoint", ioEx);
showSnackbar("Fetching user info failed");
} catch (JSONException jsonEx) {
Log.e(TAG, "Failed to parse userinfo response");
showSnackbar("Failed to parse user info");
}
runOnUiThread(this::displayAuthorized);
});
}
开发者ID:openid,项目名称:AppAuth-Android,代码行数:45,代码来源:TokenActivity.java
示例10: getUserInfo
import net.openid.appauth.AuthorizationServiceDiscovery; //导入依赖的package包/类
public void getUserInfo(Client.ResponseCallback callback) {
AuthorizationServiceDiscovery discovery = state.getAuthorizationServiceConfiguration().discoveryDoc;
get(discovery.getUserinfoEndpoint().toString(), callback);
}
开发者ID:p7s1-ctf,项目名称:7pass-android-sample,代码行数:5,代码来源:Client.java
注:本文中的net.openid.appauth.AuthorizationServiceDiscovery类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论