English | 中文
- Introduction
- Preparing the Environments
- Getting Started
- Sample Code
- Result
- Question or issues
- License
Auth Service provides cloud services and the SDK to help you quickly build a secure and reliable user authentication system for your app. Auth Service supports multiple authentication modes and is closely integrated with other serverless services, effectively protecting user data by defining simple rules.
- A computer with Android Studio installed for app development
- A device or emulator in Android Studio running Android 4.2 or a later version
Before running the quickstart app, you need to:
- If you do not have a HUAWEI Developer account, you need to register an account and pass identity verification.
- Use your account to sign in to AppGallery Connect, create an app, and set Package type to APK (Android app).
- Enable authentication modes. 3.1 Sign in to AppGallery Connect, select My apps, and click the product of the app for which you want to enable Auth Service. 3.2 Go to Develop > Build > Authentication service. If it is the first time that you use Authe Service, click Enable now in the upper right corner. 3.3 Click Enable in the row of each authentication mode to be enabled. 3.4 If an authentication mode requires related information, configure the information by referring to the development guide.
- Download the agconnect-services.json file from AppGallery Connect and replace place it in the application-level root directory (for example: quickstart is auth/app/. ) Before compiling the APK, please make sure that the project includes the agconnect-services.json file, otherwise a compilation error will occur.
The quickstart app supports the following authentication modes:
-
Anonymous account Sample code: src\main\java\com\huawei\agc\quickstart\auth\AnonymousActivity.java
-
Email address Sample code: src\main\java\com\huawei\agc\quickstart\auth\EmailActivity.java
-
Huawei game Sample code: src\main\java\com\huawei\agc\quickstart\auth\HWGameActivity.java
-
Huawei account Sample code: src\main\java\com\huawei\agc\quickstart\auth\HWIDActivity.java
-
QQ Sample code: src\main\java\com\huawei\agc\quickstart\auth\QQActivity.java If you need to integrate QQ accounts, integrate the QQ account access SDK first (for details, please refer to https://wiki.connect.qq.com/qq%E7%99%BB%E5%BD%95).
-
Self-owned account Sample code: src\main\java\com\huawei\agc\quickstart\auth\SelfBuildActivity.java
-
Weibo Sample code: src\main\java\com\huawei\agc\quickstart\auth\WeiboActivity.java
-
WeChat Sample code: src\main\java\com\huawei\agc\quickstart\auth\WeixinActivity.java
-
Facebook Sample code: src\main\java\com\huawei\agc\quickstart\auth\FacebookActivity.java
-
Google Sample code: src\main\java\com\huawei\agc\quickstart\auth\GoogleActivity.java
-
Google Play Games Sample code: src\main\java\com\huawei\agc\quickstart\auth\PlayGameActivity.java
-
Twitter Sample code: src\main\java\com\huawei\agc\quickstart\auth\TwitterActivity.java
-
Phone Sample code: src\main\java\com\huawei\agc\quickstart\auth\PhoneActivity.java
If you have questions about how to use AppGallery Connect Demos, try the following options:
- Stack Overflow is the best place for any programming questions. Be sure to tag your question with
AppGallery
. - Huawei Developer Forum AppGallery Module is great for general questions, or seeking recommendations and opinions.
If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.
crash quickstart is licensed under the [Apache License, version 2.0] (http://www.apache.org/licenses/LICENSE-2.0).