# Mini Program Login

A Mini Program can easily get the user IDs provided by Weixin using the Weixin login capability to quickly establish an internal user system.

# Login Process

# Description:

  1. Call wx.login() to get temporary login credential code, and send it back to the developer server.
  2. Call the auth.code2Session API to get the user's unique identifier (OpenID) and the session key (session_key).

Then, the developer server can generate a custom login status based on the user's identifier, so that the user can be identified during interactions between the client and backend in subsequent business logics.

Notes:

  1. The session key session_key is a key to encrypt and sign the user data. To ensure the security of app data, the developer server should not send the session key to the Mini Program or make it public.
  2. The temporary login credential code is for one-time use.