本文整理汇总了Java中com.lnikkila.oidc.OIDCAccountManager类的典型用法代码示例。如果您正苦于以下问题:Java OIDCAccountManager类的具体用法?Java OIDCAccountManager怎么用?Java OIDCAccountManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OIDCAccountManager类属于com.lnikkila.oidc包,在下文中一共展示了OIDCAccountManager类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
userInfoEndpoint = getString(R.string.op_userInfoEndpoint);
loginButton = (Button) findViewById(R.id.loginButton);
requestButton = (Button) findViewById(R.id.requestButton);
logoutButton = (Button) findViewById(R.id.logoutButton);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
progressBar.setVisibility(View.INVISIBLE);
accountManager = new OIDCAccountManager(this);
// instance = this;
}
示例2: getInstance
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的package包/类
public static synchronized AuthenticationManager getInstance(Context context) {
if (INSTANCE == null) {
INSTANCE = new AuthenticationManager();
INSTANCE.mOIDCAccountManager = new OIDCAccountManager(context);
SharedPreferences sharedPreferences = context.getSharedPreferences("oidc_clientconf", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean("oidc_loadfromprefs", true);
//Was false. When false, exception is thrown in OIDCRequestManager, line 378. id is null
editor.putBoolean("oidc_oauth2only", false);
editor.putString("oidc_clientId", Constants.CLIENT_ID);
editor.putString("oidc_redirectUrl", Constants.REDIRECT_URI);
editor.putString("oidc_scopes", Constants.SCOPES);
editor.putString("oidc_flowType", OIDCRequestManager.Flows.Code.name());
editor.apply();
}
return INSTANCE;
}
示例3: ToFluxTask
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的package包/类
public ToFluxTask(Context context, OIDCAccountManager am, Account account, String projectId, String cellId) {
Log.i("ToFlux", "creating new task");
mContext = context;
mAccountManager = am;
mAccount = account;
mProjectId = projectId;
mCellId = cellId;
}
示例4: getJson
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的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);
}
示例5: getJsonList
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的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);
}
示例6: makeRequest
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的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);
}
示例7: onCreate
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
userInfoEndpoint = getString(R.string.op_userInfoEndpoint);
loginButton = (Button) findViewById(R.id.loginButton);
requestButton = (Button) findViewById(R.id.requestButton);
logoutButton = (Button) findViewById(R.id.logoutButton);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
progressBar.setVisibility(View.INVISIBLE);
accountManager = new OIDCAccountManager(this);
}
示例8: getJson
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的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);
}
示例9: makeRequest
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的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);
}
示例10: onCreate
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_authentication);
Bundle extras = getIntent().getExtras();
// Are we supposed to create a new account or renew the authorisation of an old one?
isNewAccount = extras.getBoolean(KEY_IS_NEW_ACCOUNT, false);
// In case we're renewing authorisation, we also got an Account object that we're supposed
// to work with.
String accountName = extras.getString(KEY_ACCOUNT_NAME);
accountManager = new OIDCAccountManager(this);
keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
// starts the request manager with the OIDC client setting in /res/values/oidc_clientconf.xml
requestManager = new OIDCRequestManager(this);
if (accountName != null) {
account = accountManager.getAccountByName(accountName);
}
boolean isPasswordFlow = requestManager.getFlowType() == OIDCRequestManager.Flows.Password;
initAuthenticationWebView(isPasswordFlow);
setupPasswordGrantForm(isPasswordFlow);
}
示例11: Authenticator
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的package包/类
public Authenticator(Context context) {
super(context);
this.context = context;
this.accountManager = new OIDCAccountManager(context);
this.requestManager = new OIDCRequestManager(context);
Log.d(TAG, "Authenticator created.");
}
示例12: onCreate
import com.lnikkila.oidc.OIDCAccountManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_authentication);
Bundle extras = getIntent().getExtras();
// Are we supposed to create a new account or renew the authorisation of an old one?
isNewAccount = extras.getBoolean(KEY_IS_NEW_ACCOUNT, false);
// In case we're renewing authorisation, we also got an Account object that we're supposed
// to work with.
String accountName = extras.getString(KEY_ACCOUNT_NAME);
accountManager = new OIDCAccountManager(this);
keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
// starts the request manager with the OIDC client setting in /res/values/oidc_clientconf.xml
requestManager = new OIDCRequestManager(this);
if (accountName != null) {
account = accountManager.getAccountByName(accountName);
}
boolean isPasswordFlow = requestManager.getFlowType() == OIDCRequestManager.Flows.Password;
initAuthenticationWebView(isPasswordFlow);
//setupPasswordGrantForm(isPasswordFlow);
}