-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
AWS
committed
Aug 31, 2017
1 parent
c5067e0
commit b1fd18d
Showing
154 changed files
with
9,504 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.amazonaws</groupId> | ||
<artifactId>aws-android-sdk-auth-core</artifactId> | ||
<packaging>aar</packaging> | ||
<name>AWS SDK for Android - AWS Authentication Core</name> | ||
<description>The AWS Android SDK for AWS Authentication Core module holds the client classes that are used for enabling communication with Amazon CognitoIdentityProvider, Amazon Cognito UserPools, Facebook and Google SignIn Providers</description> | ||
<url>http://aws.amazon.com/sdkforandroid</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding> | ||
UTF-8 | ||
</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding> | ||
UTF-8 | ||
</project.reporting.outputEncoding> | ||
</properties> | ||
|
||
<parent> | ||
<groupId>com.amazonaws</groupId> | ||
<artifactId>aws-android-sdk-pom</artifactId> | ||
<version>2.6.0</version> | ||
</parent> | ||
|
||
<repositories> | ||
<repository> | ||
<id>android-support</id> | ||
<url>file://${env.ANDROID_HOME}/extras/android/m2repository/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.amazonaws</groupId> | ||
<artifactId>aws-android-sdk-core</artifactId> | ||
<optional>false</optional> | ||
<version>2.6.0</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.google.android</groupId> | ||
<artifactId>android</artifactId> | ||
<version>4.1.1.4</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.android.support</groupId> | ||
<artifactId>support-v4</artifactId> | ||
<version>24.2.0</version> | ||
<type>aar</type> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.simpligility.maven.plugins</groupId> | ||
<artifactId>android-maven-plugin</artifactId> | ||
<version>4.5.0</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<sdk> | ||
<platform>11</platform> | ||
<buildTools>19.1.0</buildTools> | ||
</sdk> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.amazonaws.mobile.auth.core" | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:versionCode="1" | ||
android:versionName="1.0" | ||
android:name="android.support.multidex.MultiDexApplication"> | ||
|
||
<application android:allowBackup="true"/> | ||
</manifest> |
58 changes: 58 additions & 0 deletions
58
...dk-auth-core/src/main/java/com/amazonaws/mobile/auth/core/DefaultSignInResultHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright 2013-2017 Amazon.com, Inc. or its affiliates. | ||
* All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.amazonaws.mobile.auth.core; | ||
|
||
import android.app.Activity; | ||
import android.app.AlertDialog; | ||
import android.content.Context; | ||
import android.util.Log; | ||
import android.widget.Toast; | ||
|
||
import com.amazonaws.mobile.auth.core.R; | ||
|
||
/** | ||
* A default base class easing the work required for implementing the SignInResultHandler for | ||
* {@link IdentityManager#signInOrSignUp(Context, SignInResultHandler)} by providing default | ||
* behavior in the case that the user cancels signing in or encounters an error. The default for | ||
* canceling is to toast that sign-in was canceled. The default for a sign-in error is to show | ||
* an alert dialog specifying the error message. | ||
*/ | ||
public abstract class DefaultSignInResultHandler implements SignInResultHandler { | ||
private static final String LOG_TAG = DefaultSignInResultHandler.class.getSimpleName(); | ||
|
||
/** | ||
* User cancelled signing in with a provider on the sign-in activity. | ||
* Note: The user is still on the sign-in activity when this call is made. | ||
* @param provider the provider the user canceled with. | ||
*/ | ||
public void onIntermediateProviderCancel(Activity callingActivity, IdentityProvider provider) { | ||
Log.d(LOG_TAG, String.format("%s Sign-In flow is canceled", provider.getDisplayName())); | ||
} | ||
|
||
/** | ||
* User encountered an error when attempting to sign-in with a provider. | ||
* Note: The user is still on the sign-in activity when this call is made. | ||
* @param provider the provider the user attempted to sign-in with that encountered an error. | ||
* @param ex the exception that occurred. | ||
*/ | ||
public void onIntermediateProviderError(Activity callingActivity, IdentityProvider provider, Exception ex) { | ||
final String failureFormatString = callingActivity.getString(R.string.sign_in_failure_message_format); | ||
Log.e(LOG_TAG, String.format(failureFormatString, | ||
provider.getDisplayName(), ex.getMessage()), ex); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
aws-android-sdk-auth-core/src/main/java/com/amazonaws/mobile/auth/core/IdentityHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright 2013-2017 Amazon.com, Inc. or its affiliates. | ||
* All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.amazonaws.mobile.auth.core; | ||
|
||
/** | ||
* Allows the application to get an asynchronous response with user's | ||
* unique identifier. | ||
*/ | ||
public interface IdentityHandler { | ||
/** | ||
* Handles the user's unique identifier. | ||
* @param identityId Amazon Cognito Identity ID which uniquely identifies | ||
* the user. | ||
*/ | ||
void onIdentityId(final String identityId); | ||
|
||
/** | ||
* Handles any error that might have occurred while getting the user's | ||
* unique identifier from Amazon Cognito. | ||
* @param exception exception | ||
*/ | ||
void handleError(final Exception exception); | ||
} |
Oops, something went wrong.