android:contentDescription="@string/ou_library_name" />
<TextView
- android:id="@+id/action_in_progress"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/logo"
- android:gravity="center"
- android:paddingTop="10dip" />
+ android:id="@+id/action_in_progress"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/logo"
+ android:layout_marginTop="15dip"
+ android:gravity="center"
+ style="@style/textLarge"
+ android:paddingTop="10dip" android:text="Signing in"/>
<Button
android:id="@+id/activity_splash_retry_button"
android:layout_height="wrap_content"
android:layout_below="@+id/action_in_progress"
android:layout_centerHorizontal="true"
- android:paddingTop="40dip" />
+ android:padding="20dip" />
</RelativeLayout>
\ No newline at end of file
public class AccountAuthenticator extends AbstractAccountAuthenticator {
- private final static String TAG = AccountAuthenticator.class.getSimpleName();
+ private final static String TAG = AccountAuthenticator.class.getName();
private Context context;
public AccountAuthenticator(Context context) {
Log.d(TAG, "getAuthToken> signIn returned token "+authToken);
} catch (AuthenticationException e) {
Log.d(TAG, "getAuthToken> caught auth exception", e);
+ am.clearPassword(account);
final Bundle result = new Bundle();
result.putString(AccountManager.KEY_ERROR_MESSAGE, e.getMessage());
return result;
} catch (Exception e2) {
Log.d(TAG, "getAuthToken> caught exception", e2);
+ am.clearPassword(account);
final Bundle result = new Bundle();
result.putString(AccountManager.KEY_ERROR_MESSAGE, "Sign in failed");
return result;
public class AuthenticatorActivity extends AccountAuthenticatorActivity {
- private final static String TAG = AuthenticatorActivity.class.getSimpleName();
+ private final static String TAG = AuthenticatorActivity.class.getName();
public final static String ARG_ACCOUNT_TYPE = "ACCOUNT_TYPE";
public final static String ARG_AUTH_TYPE = "AUTH_TYPE";
package org.evergreen_ils.auth;
public class Const {
- //public static final String ACCOUNT_TYPE = "org.evergreen_ils";
public static final String AUTHTOKEN_TYPE = "opac";
public static final String AUTHTOKEN_TYPE_LABEL = "Online Public Access Catalog";
public static final String KEY_LIBRARY_NAME = "library_name";
public static final String KEY_LIBRARY_URL = "library_url";
- public final static String AUTH_TAG = "eg_auth:";
+ public final static String AUTH_TAG = "eg_auth";
}
import android.util.Log;
public class EvergreenAuthenticator {
- private final static String TAG = EvergreenAuthenticator.class.getSimpleName();
+ private final static String TAG = EvergreenAuthenticator.class.getName();
public final static String SERVICE_AUTH = "open-ils.auth";
public final static String METHOD_AUTH_INIT = "open-ils.auth.authenticate.init";
public final static String METHOD_AUTH_COMPLETE = "open-ils.auth.authenticate.complete";
return null;
}
- @SuppressWarnings("unchecked")
public static String signIn(String library_url, String username, String password) throws AuthenticationException {
Log.d(TAG, "signIn> "+username+" "+library_url);
return authtoken;
} else if (textcode.equals("LOGIN_FAILED")) {
String desc = ((Map<String, String>) resp).get("desc");
- Log.d(TAG, "desc: "+desc);
+ Log.d(TAG, "desc: " + desc);
if (!TextUtils.isEmpty(desc)) {
throw new AuthenticationException(desc);
}
}
-
throw new AuthenticationException("Login failed");
}
}
import org.evergreen_ils.accountAccess.AccountAccess;
import org.evergreen_ils.accountAccess.AccountUtils;
import org.evergreen_ils.accountAccess.SessionNotFoundException;
+import org.evergreen_ils.auth.Const;
import org.evergreen_ils.globals.AppPrefs;
import org.evergreen_ils.globals.GlobalConfigs;
Bundle bnd = AccountUtils.getAuthToken(mCallingActivity);
String auth_token = bnd.getString(AccountManager.KEY_AUTHTOKEN);
String account_name = bnd.getString(AccountManager.KEY_ACCOUNT_NAME);
- if (TextUtils.isEmpty(auth_token) || TextUtils.isEmpty(account_name))
- return "no account";
+ String error_msg = bnd.getString(AccountManager.KEY_ERROR_MESSAGE);
+ if (TextUtils.isEmpty(auth_token) || TextUtils.isEmpty(account_name)) {
+ if (TextUtils.isEmpty(error_msg)) error_msg = "Login failed";
+ return error_msg;
+ }
Library library = AccountUtils.getLibraryForAccount(mCallingActivity, account_name, accountType);
AppPrefs.setString(AppPrefs.LIBRARY_NAME, library.name);
} else {
String extra_text;
if (!TextUtils.isEmpty(result))
- extra_text = "...failed:\n" + result;
+ extra_text = " failed:\n" + result;
else
- extra_text = "...cancelled";
+ extra_text = " cancelled";
Log.d(TAG, "progresstext += " + extra_text);
mProgressText.setText(mProgressText.getText() + extra_text);
mRetryButton.setVisibility(View.VISIBLE);