Giter Club home page Giter Club logo

huawei-account-demo's Introduction

HMS Core Account Kit Sample Code

English | δΈ­ζ–‡

Contents

Introduction

The sample code for Android encapsulates the server-side APIs of Account Kit, containing multiple demo apps for your reference or direct use. The sample code offers: hmssample: sample code package, which implements the following functions: sign-in, authorized sign-in, and sign-out logger: records logs.

Installation

To use capabilities offered in the sample code, make sure that HMS Core (APK) 4.0 has been installed on your device.

Environment Requirements

Android SDK version: 23 or later

JDK version: 1.8 or later

Configuration

Parameters in Contant.java include: CLIENT_ID: app ID, which can be obtained from AppGallery Connect CERT_URL: public key. To get it, obtain the public key URI from jwks_uri and then access this URI. ID_TOKEN_ISSUE: same as the value of iss in the ID token

Sample Code

The Java sample code for the server-side shows how to implement the following functions:

  1. Use the authorization code to obtain the access token in TokenAPIDemo.java.
  2. Use the public key to verify the ID token in IDTokenAPIDemo.java.
  3. Parse the access token in GetTokenInfoAPIDemo.java.

The Java sample code for the client-side shows how to implement the following functions:

  1. Sign-in in ID token mode.
  2. Sign-in in authorization code mode.
  3. Silent sign-in.
  4. Sign-out from an ID.
  5. Authorization revocation.

Service logic: Implement sign-in in ID token mode and authorization code mode in AccountActivity.java.

Result

The server-side Java sample code prints the access token and JSON Web Token.

Technical Support

You can visit the Reddit community to obtain the latest information about HMS Core and communicate with other developers. If you have any questions about the sample code, try the following:

  • Visit Stack Overflow, submit your questions, and tag them with huawei-mobile-services. Huawei experts will answer your questions.

  • Visit the HMS Core section in the HUAWEI Developer Forum and communicate with other developers.

    If you encounter any issues when using the sample code, submit your issues or submit a pull request.

License

The sample code is licensed under Apache License 2.0.

huawei-account-demo's People

Contributors

mike-mei avatar tiejinjiang-git avatar xuejiao-shi avatar hms-account avatar hxb-new avatar lulala703 avatar huawei-mobile-services-core avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.