本文整理汇总了Java中com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException类的典型用法代码示例。如果您正苦于以下问题:Java UserNotAuthenticatedWrapperException类的具体用法?Java UserNotAuthenticatedWrapperException怎么用?Java UserNotAuthenticatedWrapperException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserNotAuthenticatedWrapperException类属于com.lnikkila.oidc.security包,在下文中一共展示了UserNotAuthenticatedWrapperException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getJson
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
/**
* Makes a GET request and parses the received JSON string as a Map.
*/
public static Map getJson(OIDCAccountManager accountManager, String url, Account account,
AccountManagerCallback<Bundle> callback)
throws IOException, UserNotAuthenticatedWrapperException, AuthenticatorException, OperationCanceledException {
String jsonString = makeRequest(accountManager, HttpRequest.METHOD_GET, url, account, callback);
Log.i("APIUtility", jsonString);
return new Gson().fromJson(jsonString, Map.class);
}
示例2: getJsonList
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
public static List<JSONObject> getJsonList(OIDCAccountManager accountManager, String url, Account account,
AccountManagerCallback<Bundle> callback)
throws IOException, UserNotAuthenticatedWrapperException, AuthenticatorException, OperationCanceledException {
String jsonString = makeRequest(accountManager, HttpRequest.METHOD_GET, url, account, callback);
Log.i("APIUtility", jsonString);
return new Gson().fromJson(jsonString, List.class);
}
示例3: makeRequest
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
/**
* Makes an arbitrary HTTP request using the provided account.
*
* If the request doesn't execute successfully on the first try, the tokens will be refreshed
* and the request will be retried. If the second try fails, an exception will be raised.
*/
public static String makeRequest(OIDCAccountManager accountManager, String method, String url, Account account,
AccountManagerCallback<Bundle> callback)
throws IOException, UserNotAuthenticatedWrapperException, AuthenticatorException, OperationCanceledException {
return makeRequest(accountManager, method, url, "", account, true, callback);
}
示例4: getJson
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
/**
* Makes a GET request and parses the received JSON string as a Map.
*/
public static Map getJson(OIDCAccountManager accountManager, String url, Account account,
AccountManagerCallback<Bundle> callback)
throws IOException, UserNotAuthenticatedWrapperException, AuthenticatorException, OperationCanceledException {
String jsonString = makeRequest(accountManager, HttpRequest.METHOD_GET, url, account, callback);
return new Gson().fromJson(jsonString, Map.class);
}
示例5: makeRequest
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
/**
* Makes an arbitrary HTTP request using the provided account.
*
* If the request doesn't execute successfully on the first try, the tokens will be refreshed
* and the request will be retried. If the second try fails, an exception will be raised.
*/
public static String makeRequest(OIDCAccountManager accountManager, String method, String url, Account account,
AccountManagerCallback<Bundle> callback)
throws IOException, UserNotAuthenticatedWrapperException, AuthenticatorException, OperationCanceledException {
return makeRequest(accountManager, method, url, account, true, callback);
}
示例6: invalidateAllAccountTokens
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
public void invalidateAllAccountTokens(Account account) {
if(account != null) {
try {
String idToken = getIdToken(account.name, null);
String accessToken = getAccessToken(account.name, null);
String refreshToken = getRefreshToken(account.name, null);
this.secureStorage.invalidateStringData(this.manager, account, idToken);
this.secureStorage.invalidateStringData(this.manager, account, accessToken);
this.secureStorage.invalidateStringData(this.manager, account, refreshToken);
} catch (AuthenticatorException | UserNotAuthenticatedWrapperException | OperationCanceledException | IOException e) {
Log.w(TAG, String.format("Could not invalidate account %1$s tokens", account.name), e);
}
}
}
示例7: invalidateAuthTokens
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
public void invalidateAuthTokens(Account account) {
if(account != null) {
try {
String idToken = getIdToken(account.name, null);
String accessToken = getAccessToken(account.name, null);
this.secureStorage.invalidateStringData(this.manager, account, idToken);
this.secureStorage.invalidateStringData(this.manager, account, accessToken);
} catch (AuthenticatorException | UserNotAuthenticatedWrapperException | OperationCanceledException | IOException e) {
Log.w(TAG, String.format("Could not invalidate account %1$s tokens", account.name), e);
}
}
}
示例8: invalidateAccessToken
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
public void invalidateAccessToken(Account account) {
if(account != null) {
try {
String accessToken = getAccessToken(account, null);
this.secureStorage.invalidateStringData(this.manager, account, accessToken);
} catch (AuthenticatorException | UserNotAuthenticatedWrapperException | OperationCanceledException | IOException e) {
Log.w(TAG, String.format("Could not invalidate account %1$s AT", account.name), e);
}
}
}
示例9: saveTokens
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
public void saveTokens(Account account, TokenResponse tokenResponse) throws UserNotAuthenticatedWrapperException {
if (tokenResponse instanceof IdTokenResponse) {
saveToken(account, Authenticator.TOKEN_TYPE_ID, ((IdTokenResponse) tokenResponse).getIdToken());
}
saveToken(account, Authenticator.TOKEN_TYPE_ACCESS, tokenResponse.getAccessToken());
saveToken(account, Authenticator.TOKEN_TYPE_REFRESH, tokenResponse.getRefreshToken());
}
示例10: saveTokens
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
private void saveTokens(TokenResponse response) {
try {
accountManager.saveTokens(account, response);
} catch (UserNotAuthenticatedWrapperException e) {
showAuthenticationScreen(ASK_USER_ENCRYPT_PIN_REQUEST_CODE);
}
}
示例11: getRetrofit
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
/**
* Returns a retrofit rest adaptor class. The adaptor is created in calling code.
*
* @return A new RestAdapter instance.
*/
public Retrofit getRetrofit(final Context context) {
//This method catches outgoing REST calls and injects the Authorization and host headers before
//sending to REST endpoint
Interceptor interceptor = new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
try {
final String token = AuthenticationManager.getInstance(context).getAccessToken();
Request request = chain.request();
request = request.newBuilder()
.addHeader("Authorization", "Bearer " + token)
// This header has been added to identify this sample in the Microsoft Graph service.
// If you're using this code for your project please remove the following line.
.addHeader("SampleID", "android-java-connect-rest-sample")
.build();
Response response = chain.proceed(request);
return response;
} catch (AuthenticatorException | IOException | UserNotAuthenticatedWrapperException | OperationCanceledException e) {
Log.e(TAG, e.getMessage());
return null;
}
}
};
return getRetrofit(interceptor);
}
示例12: getIdToken
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
public String getIdToken(String accountName, AccountManagerCallback<Bundle> callback)
throws AuthenticatorException, UserNotAuthenticatedWrapperException, OperationCanceledException, IOException {
return getToken(accountName, Authenticator.TOKEN_TYPE_ID, callback);
}
示例13: getAccessToken
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
public String getAccessToken(Account account, AccountManagerCallback<Bundle> callback)
throws AuthenticatorException, UserNotAuthenticatedWrapperException, OperationCanceledException, IOException {
return getToken(account, Authenticator.TOKEN_TYPE_ACCESS, callback);
}
示例14: getRefreshToken
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
public String getRefreshToken(String accountName, AccountManagerCallback<Bundle> callback)
throws AuthenticatorException, UserNotAuthenticatedWrapperException, OperationCanceledException, IOException {
return getToken(accountName, Authenticator.TOKEN_TYPE_REFRESH, callback);
}
示例15: getToken
import com.lnikkila.oidc.security.UserNotAuthenticatedWrapperException; //导入依赖的package包/类
private String getToken(String accountName, String tokenType, AccountManagerCallback<Bundle> callback)
throws AuthenticatorException, UserNotAuthenticatedWrapperException, OperationCanceledException, IOException {
Account account = getAccountByName(accountName);
return getToken(account, tokenType, callback);
}