当前位置: 首页>>代码示例>>Java>>正文


Java OIDCAccountManager类代码示例

本文整理汇总了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;
    }
 
开发者ID:tdb-alcorn,项目名称:defect-party,代码行数:17,代码来源:LoginActivity.java

示例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;
}
 
开发者ID:microsoftgraph,项目名称:android-java-connect-rest-sample,代码行数:20,代码来源:AuthenticationManager.java

示例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;
}
 
开发者ID:tdb-alcorn,项目名称:defect-party,代码行数:9,代码来源:APIUtility.java

示例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);
}
 
开发者ID:tdb-alcorn,项目名称:defect-party,代码行数:12,代码来源:APIUtility.java

示例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);
}
 
开发者ID:tdb-alcorn,项目名称:defect-party,代码行数:9,代码来源:APIUtility.java

示例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);
}
 
开发者ID:tdb-alcorn,项目名称:defect-party,代码行数:13,代码来源:APIUtility.java

示例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);
}
 
开发者ID:kalemontes,项目名称:OIDCAndroidLib,代码行数:16,代码来源:HomeActivity.java

示例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);
}
 
开发者ID:kalemontes,项目名称:OIDCAndroidLib,代码行数:11,代码来源:APIUtility.java

示例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);
}
 
开发者ID:kalemontes,项目名称:OIDCAndroidLib,代码行数:13,代码来源:APIUtility.java

示例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);
}
 
开发者ID:kalemontes,项目名称:OIDCAndroidLib,代码行数:29,代码来源:AuthenticatorActivity.java

示例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.");
}
 
开发者ID:kalemontes,项目名称:OIDCAndroidLib,代码行数:10,代码来源:Authenticator.java

示例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);
}
 
开发者ID:microsoftgraph,项目名称:android-java-connect-rest-sample,代码行数:29,代码来源:AuthenticatorActivity.java


注:本文中的com.lnikkila.oidc.OIDCAccountManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。