Employee Identity (EIAM)

Password Login

# Documentation Description

This document explains how to integrate the password login functionality in the iOS client.

# Process Description

Login Scenarios:

  1. Username + Password Login: The user enters a username and password. The IDaaSSDK verifies the username and password and returns a session_token and id_token to the APP client.

  2. Phone Number + Password Login: The user enters a phone number and password. The IDaaSSDK verifies the phone number and password and returns a session_token and id_token to the APP client.

  3. Email + Password Login: The user enters an email and password. The IDaaSSDK verifies the email and password and returns a session_token and id_token to the APP client.

  4. Unified User Password Login Interface: Allows implementing username/phone number/email + password login on a single page, returning session_token and id_token to the APP client.

Processes serving the login scenario:

  1. After clicking the login button, the system returns a notification that the password is about to expire, prompting the user to change it. This can be ignored, or the user can be redirected to the password change page.

  2. After clicking the login button, the system returns a notification that the password has expired, forcing the user to change the password.

  3. Forgot password before login, recover password via phone number.

# Login Process

Integration Process Description

  1. Enter username + password / phone number + password / email + password, and click the login button.

  2. The APP client calls the login method (4 types).

  3. The IDaaS SDK calls the IDaaS server for authentication. The authentication result falls into four categories (success, password about to expire, password expired, failure).

  4. In case of success, the IDaaS server returns session_token and id_token.

  5. The IDaaS SDK returns session_token and id_token to the APP client.

  6. If the password is about to expire, the IDaaS server returns the password-about-to-expire parameter.

  7. The IDaaS SDK returns the password-about-to-expire notification to the APP client.

  8. The user can choose to skip changing the password or change it directly.

  9. Based on the user's button click, the APP client calls the skip password change method or the change password method.

  10. The IDaaS SDK calls the IDaaS server's skip password change interface or the change password interface.

  11. The IDaaS server validates and returns session_token and id_token upon success, or returns an error code upon failure.

  12. The IDaaS SDK returns the success/failure parameters to the APP client.

  13. If the password has already expired, the IDaaS server returns the forced password change parameter to the IDaaS SDK.

  14. The IDaaS SDK returns the forced password change parameter to the client APP.

  15. The user is forced to change the password. The APP client calls the change password method.

  16. The IDaaS SDK calls the IDaaS server's change password interface.

  17. The IDaaS server, upon successful password change, returns session_token and id_token to the IDaaS SDK / upon failure, returns an error code.

  18. The IDaaS SDK, upon successful password change, returns session_token and id_token to the APP client / upon failure, returns an error code.

  19. The client can use the id_token to verify the login validity period and obtain basic user information.

  20. The client can use the session_token to refresh the id_token.

# Password Recovery Process

Integration Process Description

  1. The user clicks the "Forgot Password" button.

  2. The APP client displays the password recovery page, which must be provided by the APP itself.

  3. The user enters a phone number and clicks the "Get Verification Code" button.

  4. The APP calls the slider verification method.

  5. The IDaaS SDK requests the IDaaS server's slider verification interface.

  6. The IDaaS server returns slider verification parameters.

  7. The IDaaS SDK launches and displays the slider verification window.

  8. The user drags the slider for verification.

  9. The IDaaS SDK sends the slider verification to the IDaaS server.

  10. The IDaaS server returns the slider verification result.

  11. The IDaaS SDK returns the slider verification result to the APP client.

  12. The APP client uses the slider token to call the IDaaS SDK's method for sending the SMS verification code.

  13. The IDaaS SDK calls the IDaaS server's interface for sending the verification code.

  14. The IDaaS server returns the result of sending the verification code to the IDaaS SDK.

  15. The IDaaS SDK returns the result of sending the verification code to the APP client.

  16. The user receives the SMS verification code, enters it, and clicks the "Recover Password" button.

  17. The APP client uses the mobile phone number + verification code + new password to call the IDaaS SDK's password recovery method.

  18. The IDaaS SDK calls the IDaaS server's password recovery interface.

  19. The IDaaS server returns the password recovery result to the IDaaS SDK.

  20. The IDaaS SDK returns the password recovery result to the APP client.

# Environment Setup

# Obtain clientID

Log in to the IDaaS Enterprise Center platform, click "Resources -> Applications", select the application relevant to you, and click to view it.

# Password Policy Settings

This setting is to configure the password expiration time and reminder duration. First, navigate to the password policy module following the path shown in the figure below.

Password expiration can be enabled below:

After enabling, you can set how long the password expires and the number of days for advance notification as shown in the figure below.

This setting is for the IDaaS server to detect, after login, how long the currently used password needs to be changed, and to prompt the user to change it several days in advance. After enabling password expiration check, it will be checked according to the configured settings parameters each time you log in.

# Introducing Dependencies

No third-party SDK dependencies.

# Adding the Main Library

AuthnCenter_common_2E.framework
AuthnCenter_PWLogin_2E.framework
AuthnCenter_PWLogin_2E.bundle
1
2
3

Drag the IDaaSSDK into the project, and introduce it as follows:

And introduce the Pod dependencies.

pod 'JWT', '~> 3.0.0-beta.14'

# Targets Settings

  • The minimum version compatible with the IDaaS password login SDK is iOS 10.

  • Add the main library and dependencies in Framework, Libraries, and Embedded Content, and add -ObjC in Other Linker Flags.

  • In the menu bar, select TARGETS > Info > Custom iOS Target Properties > App Transport Security Settings > Allow Arbitrary Loads, as shown below.

  • Set bitcode, as shown below, set bitcode to NO.

# Development Integration

# Built-in API Introduction

  1. After integration, choose a login method (username password / mobile phone number password / email password / unified username password), you need to call the forced password change or skip password change method (change password method / skip password change).
  2. You can recover the password via mobile phone number. The APP client builds its own password recovery page, which needs to have three elements: mobile number input box, verification code input box, get verification code button, and recover button. Click the get verification code button to call IDaaS.
    • SDK slider verification method and call IDaaS.
    • SDK send SMS method. After receiving the verification code, click the recover button, and the APP client calls IDaaS.
    • SDK password recovery method.

# SDK Initialization

Place the initialization method in the appdelegate's didFinishLaunchingWithOptions method.

Reference the following in appdelegate
#import <AuthnCenter_common_2E /BCIDACommonManager.h>

//1. Basic configuration initialization
[[[[[BCIDACommonManager sharedInstance] initWithDomain:@"https://your-server-tenant.com"] initWithClientID:@"server-tenant-clientID"] initWithSSLCerVerification:NO] setLogEnabled:YES] ;
1
2
3
4
5

Introduction to the methods for initializing the main class BCIDACommonManager with basic configuration:

/**
  * Function name: sharedInstance
   * @param None
   * @return Singleton object instance class
 */
+ (instancetype )sharedInstance ;

/**
  * Function name: initWithDomain
   * @param domain, starts with https:// and ends with .com.
   * @return Instance class
 */
-(BCIDACommonManager)initWithDomain:(NSString)domain

/**
  * Function name: initWithClientID
   * @param client id.
   * @return Instance class
 */
-(BCIDACommonManager)initWithClientID:(NSString)clientID;

/**
  * Function name: setLogEnabled
   * @param Boolean value indicating whether to enable log.
   * @return Instance class
 */
-(void)setLogEnabled:(BOOL)enable;

/**
  * Function name: initWithSSLCerVerification
   * @param Boolean value to set whether SSL certificate verification is enabled.
   * @return Instance class
 */
-(BCIDACommonManager*)initWithSSLCerVerification:(bool)sslCerVerification;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

# Obtaining International Mobile Phone Area Codes

If international phone number support is enabled, please first call the international area code retrieval interface yourself. The international area code retrieval interface returns a configured list of international area codes, along with regular expressions for phone numbers. The following image shows how to configure the international area code list and the preferred area code.

The IDaaS SDK provides an API for obtaining international area codes:

Example code for retrieving the international area code list:

#import <AuthnCenter_common_2E/BCIDAInternationalPhoneCodeManager.h>


[BCIDAInternationalPhoneCodeManager getInternaltionalAreaCodeWithCompletionHandler:^(NSString * _Nonnull code, id  _Nonnull data) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        dispatch_async(dispatch_get_main_queue(), ^{
            NSDictionary* dic=(NSDictionary*)data;
        //Check if the phone number matches the regular expression 
 BOOL flag=  [strongSelf parseDictionary:dic andWithMoile:mobile];
            
        });
    }];
1
2
3
4
5
6
7
8
9
10
11
12

Introduction to the main class method:

/**
* Function name: getInternaltionalAreaCodeWithCompletionHandler
* @brief: Method to obtain international area codes
* @param 
*@param 
* @param BCSMSGetInternationalAreaCodeHandlerBlock () Result callback function code=0, data returns NSDictionary result
**/
+(void)getInternaltionalAreaCodeWithCompletionHandler:(BCSMSGetInternationalAreaCodeHandlerBlock)resultHander;
1
2
3
4
5
6
7
8

Successful example with code=0, value of data:

{
	"phoneAreaCodeDefinitions": [
		{
			"areaCode": "86",
			"displayMapping": {
				"zh-TW": "中國大陸",
				"en": "China",
				"zh-CN": "中国大陆"
			},
			"countryCode": "CN",
			"mobileRegex": "^(\\+86){0,1}\\-?1\\d{10}$",
			"areaCodeSuffixes": []
		},
		{
			"areaCode": "852",
			"displayMapping": {
				"zh-TW": "中國香港",
				"en": "Hong Kong",
				"zh-CN": "中国香港"
			},
			"countryCode": "HK",
			"mobileRegex": "^(\\+852){1}\\-?0{0,1}[1,4,5,6,7,8,9](?:\\d{7}|\\d{8}|\\d{12})$",
			"areaCodeSuffixes": []
		},
		{
			"areaCode": "886",
			"displayMapping": {
				"zh-TW": "中國臺灣",
				"en": "Taiwan",
				"zh-CN": "中国台湾"
			},
			"countryCode": "TW",
			"mobileRegex": "^(\\+886){1}\\-?[6,7,9](?:\\d{7}|\\d{8})$",
			"areaCodeSuffixes": []
		},
		{
			"areaCode": "853",
			"displayMapping": {
				"zh-TW": "中國澳門",
				"en": "Macau",
				"zh-CN": "中国澳门"
			},
			"countryCode": "MO",
			"mobileRegex": "^(\\+853){1}\\-?0{0,1}[1,4,5,6,7,8,9](?:\\d{7}|\\d{8}|\\d{12})$",
			"areaCodeSuffixes": []
		},
		{
			"areaCode": "93",
			"displayMapping": {
				"zh-TW": "阿富汗",
				"en": "Afghanistan",
				"zh-CN": "阿富汗"
			},
			"countryCode": "AF",
			"mobileRegex": "^(\\+93){1}\\-\\d{6,11}",
			"areaCodeSuffixes": []
		}
	],
	"preferredAreaCode": "CN"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

Return Parameter Format:

Parameter Name Chinese Name Type Description
preferredAreaCode Preferred International Dialing Code String The preferred international dialing code configured for the current enterprise center.
countryCode Country/Region Code String Country/Region Code
areaCode International Telephone Dialing Code String International Telephone Dialing Code
areaCodeSuffixes International Telephone Dialing Code Suffix String International Telephone Dialing Code Suffix
mobileRegex Mobile Number Format Regular Expression String Mobile Number Format Regular Expression
displayMapping Multi-language Display Name Mapping String Multi-language Display Name Mapping

# Built-in Slider Verification

This slider verification requires two methods to work with the "Retrieve Password via Mobile Number" and "Mobile Number SMS Verification Code Registration" pages.

  1. Please perform mobile number format validation before calling this method.

  2. Click (trigger) the send verification code event, and the App client calls the IDaaS SDK's slider verification method. Example as follows:

//Import header file
#import <AuthnCenter_PWLogin_2E/BCPWSlideVerifyCodeManager.h>

//Click (trigger) the send verification code event
 [BCPWSlideVerifyCodeManager startSlidingVerifyCodePageWithMobileNumber:mobile andWithResultHandler:^(NSString * _Nonnull code, id  _Nonnull data) {
       
    //Result processing

    }];
1
2
3
4
5
6
7
8
9

Introduction to BCPWSlideVerifyCodeManager Object Methods:

/**
* Function name: startSlidingVerifyCodePageWithMobileNumber
* @brief: Click to launch the sliding block verification
* @param mobile phone number: With area code "+86-13800000000" or without area code "13800000000" are both acceptable.
* @param complete: Asynchronous result callback:
1. When the sliding block verification is successful, returns code=0 data=sliding block token
2. When the sliding block verification fails, returns code=other (refer to error codes)
3. When code=105, data="User closed" means the close button of the sliding block frame was clicked, to allow the APP client to receive the user's action of closing the sliding block
**/

+(void)startSlidingVerifyCodePageWithMobileNumber:(NSString*)mobile andWithResultHandler:(BCPWSlideCodeHandlerBlock)resultHandler;
1
2
3
4
5
6
7
8
9
10
11

Code example for sending SMS when the sliding block verification is successful (code=0):

// When forgetting password (changing password via mobile number) select type:
   pwSlideSMSSendType     type= pwSlideSMSForgetPassword;
 // When registering a new user with a mobile number, select type:
  pwSlideSMSSendType      type= pwSlideSMSRegist;

[BCPWSlideVerifyCodeManager sendSMSWithSlideResultWithToken:token andMobile:mobile andWithType:type andWithCallBack:^(NSString * _Nonnull code, id  _Nonnull data) {
        if ([code isEqualToString:@"0"]) {
            NSLog(@"SMS sent successfully--code=%@   data=%@",code,data);
        }else{
            NSLog(@"SMS sending failed--code=%@   data=%@",code,data);

        }
        
    }];
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Introduction to the BCPWSlideVerifyCodeManager method for sending SMS:

/**
* Function name: sendSMSWithSlideResultWithToken
* @brief: Call this method to send an SMS,
* @param token The token obtained after successful sliding block verification in the previous method
* @param mobile phone number
* @param mobile (pwSlideSMSSendType enumeration) type
When sending SMS verification code for forgotten password: input parameter type= pwSlideSMSForgetPassword
When sending SMS verification code for registering a new user: input parameter type= pwSlideSMSRegist

* @param complete: Asynchronous result callback, returns code=0 when SMS is sent successfully, code=other when SMS sending fails
**/

+(void)sendSMSWithSlideResultWithToken:(NSString*)token andMobile:(NSString*)mobile andWithType:(pwSlideSMSSendType)type andWithCallBack:(BCPWSendSMSHandlerBlock)callBack;
1
2
3
4
5
6
7
8
9
10
11
12
13

# Username and Password Login

Code example:

// Import the request header
#import <AuthnCenter_PWLogin_2E/BCUserNamePWLoginManager.h>

// Click (trigger) to send the verification code event
[[BCUserNamePWLoginManager sharedInstance] loginByUserName:userName andWithPassword:passWord andWithCallBackHandler:^(NSString * _Nonnull code, id  _Nonnull data) {            
 dispatch_async(dispatch_get_main_queue(), ^{
            NSLog(@"Result==%@==%@",code,data);
            
            });
 }];
1
2
3
4
5
6
7
8
9
10

Introduction to BCUserNamePWLoginManager Object Methods:

/**
  * Function name: sharedInstance
   * @param None
   * @return Singleton object instance class
 */
+ (instancetype )sharedInstance ;

/**
* Function name: loginByUserName
* @brief: Username + password login.
On successful login, code=0 data=session_token.
On unsuccessful login, returns code=error code, data returns the error reason.
*@ param username The username.
*@ param password The password.
*@param BCUserNamePWLoginHandlerBlock: Asynchronous result callback containing two return parameters NSString code, and id type data:
1. code=0 success, data returns session_token and id_token,
2. code=101 indicates a prompt that the password needs to be changed or is about to expire, a redirect should be performed
data =【status= PASSWORD_WARN】Password not expired but about to expire
             【status= PASSWORD_EXPIRED】Password expired, must be changed
3. code=1 error data (NSDictionary type) returns "error_code" and "error_msg"
**/

-(void)loginByUserName:(NSString*)username andWithPassword:(NSString*)password andWithCallBackHandler:(BCUserNamePWLoginHandlerBlock)callBack;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Return Parameter List:

Success Example 1 (Successfully matches user and returns session_token):
code=0
data=
{
    "session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
    "id_token": content,
    "expire": 432000,
    "status": "SUCCESS"
}
Success Example 2 (Returns password about to expire flow):
code=101
data=
{
    "status": "PASSWORD_WARN",
	"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJ1c2VySWRcIjpcIjIwMjIwMjExMTY0NDUwNjk5LTE2M0QtNTVFMEI1RTRCXCIsXCJzdGF0dXNcIjpcIlBBU1NXT1JEX0VYUElSRURcIn0iLCJleHAiOjE2NDQ1NzEzNjAsImlhdCI6MTY0NDU2OTU2MCwianRpIjoiMTY0NDU2OTU2MDIwNDAifQ.WGk9GGQGmKsmo4UmCzKfiC9x1Fj0WBowdO7jEStMvB4",
	"data": "{\"maxLength\":18,\"minLength\":8,\"regEx\":\"^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![a-z0-9]+$)(?![a-z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)[a-zA-Z0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]{1,}$\",\"tip\":\"至少包含数字、大写字母、小写字母和特殊字符中的3种\"}"
}
Success Example 3 (Returns password expired flow):
Code=101,
data=
{
    "status": "PASSWORD_EXPIRED",
    "state_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN0Ijoie1wic3RhdGVcIjpcIlBBU1NXT1JEX1dBUk5cIixcInVzZXJJZFwiOlwiMjAyMTA3MjYxNzQwNTgxNDUtOTFCQy0xM0UwMTRBQkJcIn0iLCJpZCI6IjIwMjEwNzI2MTc0MDU4MTQ1LTkxQkMtMTNFMDE0QUJCIiwiZXhwIjoxNjI43MTkwLCJpYXQiOjEasd2Mjg4NDY1OTB9.-egHWNfNPIxNnM540_wTYMtFwB4C9ymznEPRiIC4we0",
    "data": "{\"maxLength\":18,\"minLength\":8,\"regEx\":\"^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![a-z0-9]+$)(?![a-z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)[a-zA-Z0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]{1,}$\",\"tip\":\"至少包含数字、大写字母、小写字母和特殊字符中的3种\"}"
}

Error Example
{
    "error_code": "SDK.COMMON.1001",
    "error_msg": "Parameter X-client-id cannot be left blank."
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

# Mobile Number and Password Login {/examples/}

Code Example:

// Import the request header
#import <AuthnCenter_PWLogin_2E/BCPhonePWLoginManager.h>

// Click (trigger) the login button
[[BCPhonePWLoginManager sharedInstance] loginByPhoneNumber:phoneStr andWithPassword:passWord andWithCallBackHandler:^(NSString * _Nonnull code, id  _Nonnull data) {

            dispatch_async(dispatch_get_main_queue(), ^{
            NSLog(@"Result==%@==%@",code,data);

            });
        }];
1
2
3
4
5
6
7
8
9
10
11

Introduction to BCPhonePWLoginManager Object Methods:

/**
  * Function name: sharedInstance
   * @param None
   * @return Singleton object instance class
 */
+ (instancetype )sharedInstance ;


/**
* Function name: loginByPhoneNumber
* @brief: Mobile number + password login
*@ param username Username.
*@ param password Password.
*@param BCPhonePWLoginHandlerBlock: Asynchronous result callback containing two return parameters NSString code, and id type data:
1. code=0 success, data returns session_token and id_token,
2. code=101 indicates a need to change the password or the password is about to expire, should redirect
data = 【status= PASSWORD_WARN】Password not expired but about to expire
             【status= PASSWORD_EXPIRED】Password expired, must be changed
3. code=1 Error data (NSDictionary type) returns "error_code" and "error_msg"

**/
-(void) loginByPhoneNumber:(NSString*)mobile andWithPassword:(NSString*)password andWithCallBackHandler:(BCPhonePWLoginHandlerBlock)callBack;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Return Parameter List:

Success Example 1 (Successfully matched user returns session_token):
code=0
data=
{
    "session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
    "id_token": content,
    "expire": 432000,
    "status": "SUCCESS"
}
Success Example 2 (Returns password about to expire process):
code=101
data=
{
    "status": "PASSWORD_WARN",
	"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJ1c2VySWRcIjpcIjIwMjIwMjExMTY0NDUwNjk5LTE2M0QtNTVFMEI1RTRCXCIsXCJzdGF0dXNcIjpcIlBBU1NXT1JEX0VYUElSRURcIn0iLCJleHAiOjE2NDQ1NzEzNjAsImlhdCI6MTY0NDU2OTU2MCwianRpIjoiMTY0NDU2OTU2MDIwNDAifQ.WGk9GGQGmKsmo4UmCzKfiC9x1Fj0WBowdO7jEStMvB4",
	"data": "{\"maxLength\":18,\"minLength\":8,\"regEx\":\"^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![a-z0-9]+$)(?![a-z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)[a-zA-Z0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]{1,}$\",\"tip\":\"至少包含数字、大写字母、小写字母和特殊字符中的3种\"}"
}
Success Example 3 (Returns password expired process):
Code=101,
data=
{
    "status": "PASSWORD_EXPIRED",
    "state_token":"eyJhbGciOiJIUzI1NitFwmznEPRiIC4we0",
    "data": "{\"maxLength\":18,\"minLength\":8,\"regEx\":\"^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![a-z0-9]+$)(?![a-z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)[a-zA-Z0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]{1,}$\",\"tip\":\"至少包含数字、大写字母、小写字母和特殊字符中的3种\"}"
}

Error Example
{
    "error_code": "SDK.COMMON.1001",
    "error_msg": "Parameter X-client-id cannot be left blank."
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

# Email Password Login

Code Example:

// Import the request header
#import <AuthnCenter_PWLogin_2E/BCEmailPWLoginManager.h>

// Click (trigger) the login button
[[BCEmailPWLoginManager sharedInstance] loginByEmail:emailStr andPassword:passWord andWithCallBackHandler:^(NSString * _Nonnull code, id  _Nonnull data) {          
            dispatch_async(dispatch_get_main_queue(), ^{
            NSLog(@"Result==%@==%@",code,data);
            
            });
        }];
1
2
3
4
5
6
7
8
9
10

BCEmailPWLoginManager Object Method Introduction:

/**
  * Function name: sharedInstance
   * @param None
   * @return Singleton object instance class
 */
+ (instancetype )sharedInstance ;


/**
* Function name: loginByEmail
* @brief: Email + password login. If unsuccessful, returns code=error code, data returns error reason. If password sending is successful, code=0 data=session_token.
*@ param email Username.
*@ param password Password.
*@param BCEmailPWLoginHandlerBlock: Asynchronous result callback containing two return parameters NSString code, and id type data:
1. code=0 success, data returns session_token and id_token,
2. code=101 indicates a prompt that the password needs to be changed or is about to expire, a jump should be performed
data =【status= PASSWORD_WARN】Password not expired but about to expire
             【status= PASSWORD_EXPIRED】Password has expired and must be changed
3. code=1 error data (NSDictionary type) returns "error_code" and "error_msg"

**/

-(void)loginByEmail:(NSString*)email andPassword:(NSString*)password andWithCallBackHandler:(BCEmailPWLoginHandlerBlock)callBack;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Return Parameter List:

Success Example 1 (Successfully matched user returns session_token):
code=0
data=
{
    "session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
    "id_token":"xxxxxx",
    "expire": 432000,
    "status": "SUCCESS"
}

Success Example 2 (Returns password about to expire flow):
code=101
data=
{
    "status": "PASSWORD_WARN",
	"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJ1c2VySWRcIjpcIjIwMjIwMjExMTY0NDUwNjk5LTE2M0QtNTVFMEI1RTRCXCIsXCJzdGF0dXNcIjpcIlBBU1NXT1JEX0VYUElSRURcIn0iLCJleHAiOjE2NDQ1NzEzNjAsImlhdCI6MTY0NDU2OTU2MCwianRpIjoiMTY0NDU2OTU2MDIwNDAifQ.WGk9GGQGmKsmo4UmCzKfiC9x1Fj0WBowdO7jEStMvB4",
	"data": "{\"maxLength\":18,\"minLength\":8,\"regEx\":\"^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![a-z0-9]+$)(?![a-z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)[a-zA-Z0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]{1,}$\",\"tip\":\"至少包含数字、大写字母、小写字母和特殊字符中的3种\"}"
}

Success Example 3 (Returns password expired flow):
Code=101,
data=
{
    "status": "PASSWORD_EXPIRED",
    "state_token":"e_wTYMtFwB4C9ymznEPRiIC4we0",
    "data": "{\"maxLength\":18,\"minLength\":8,\"regEx\":\"^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![a-z0-9]+$)(?![a-z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)[a-zA-Z0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]{1,}$\",\"tip\":\"至少包含数字、大写字母、小写字母和特殊字符中的3种\"}"
}

Error Example
{
    "error_code": "SDK.COMMON.1001",
    "error_msg": "Parameter X-client-id cannot be left blank."
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

# Unified Username and Password Login {/examples/}

Code Example:

// Import the request header
#import <AuthnCenter_PWLogin_2E/BCAllInOnePWLoginManager.h>

// Click (trigger) the login button
[[BCAllInOnePWLoginManager sharedInstance] loginByAllInOneString:userName andWithPassword:passWord andWithCallBackHandler:^(NSString * _Nonnull code, id  _Nonnull data) {        

            dispatch_async(dispatch_get_main_queue(), ^{
            NSLog(@"Result==%@==%@",code,data);
            
            });
        }];
1
2
3
4
5
6
7
8
9
10
11

Introduction to BCAllInOnePWLoginManager Object Methods:

/**
  * Function name: sharedInstance
   * @param None
   * @return Singleton object instance class
 */
+ (instancetype )sharedInstance ;

/**
* Function name: loginByAllInOneString
* @brief: Unified login field + password login. If unsuccessful, returns code=error code, data returns error reason. Sending password successfully returns code=0 data=session_token.
*@ param allStr Unified login field.
*@ param password Password.
*@param BCAllInOnePWLoginHandlerBlock: Asynchronous result callback containing two return parameters NSString code, and id type data:
1. code=0 success, data returns session_token and id_token,
2. code=101 indicates that the password needs to be changed or is about to expire, and a redirect should be performed.
data =【status= PASSWORD_WARN】Password not expired but about to expire
             【status= PASSWORD_EXPIRED】Password expired and must be changed
3. code=1 error data (NSDictionary type) returns "error_code" and "error_msg"

**/
-(void)loginByAllInOneString:(NSString*)allStr andWithPassword:(NSString*)password andWithCallBackHandler:(BCAllInOnePWLoginHandlerBlock)callBack;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

Return Parameter List:

Success Example 1 (Successfully matched user returns session_token):
code=0
data=
{
    "session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
    "id_token": content,
    "expire": 432000,
    "status": "SUCCESS"
}

Success Example 2 (Returns password about to expire process):
code=101
data=
{
    "status": "PASSWORD_WARN",
	"state_token": "eyJhFj0WBowdO7jEStMvB4",
	"data": "{\"maxLength\":18,\"minLength\":8,\"regEx\":\"^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![a-z0-9]+$)(?![a-z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)[a-zA-Z0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]{1,}$\",\"tip\":\"至少包含数字、大写字母、小写字母和特殊字符中的3种\"}"
}
Success Example 3 (Returns password expired process):
Code=101,
data=
{
    "status": "PASSWORD_EXPIRED",
    "state_token":"eyJhbGciHWNfNPIxNnM540_wTYMtFwB4C9ymznEPRiIC4we0",
    "data": "{\"maxLength\":18,\"minLength\":8,\"regEx\":\"^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![a-z0-9]+$)(?![a-z~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)(?![0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]+$)[a-zA-Z0-9~!#$%&+\\\\-,*:;<=>@_?^、`~\\\\./]{1,}$\",\"tip\":\"至少包含数字、大写字母、小写字母和特殊字符中的3种\"}"
}

Error Example
{
    "error_code": "SDK.COMMON.1001",
    "error_msg": "Parameter X-client-id cannot be left blank."
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

# Skip Password Modification

Code Example:

// Import header
#import <AuthnCenter_PWLogin_2E/BCPWPassWordUpdateManager.h>

// Click (trigger) login button
[[BCPWPassWordUpdateManager sharedInstance] skipPassWordModifyWithStateToken:state_token andWithCallBackHandler:^(NSString * _Nonnull code, id  _Nonnull data) {
        NSString* msg=[NSString stringWithFormat:@"Result after skipping password modification: code=%@-------data=%@",code,data];
          }];
1
2
3
4
5
6
7

Introduction to BCPWPassWordUpdateManager Object Methods:

/**
  * Function name: sharedInstance
   * @param None
   * @return Singleton object instance class
 */
+ (instancetype )sharedInstance ;

/**
* Function name: skipPassWordModifyWithStateToken
* @brief: Skip password modification, only for use when the login interface returns status: "PASSWORD_WARN" (when the login interface code=101)
*@ param state_token The state_token field returned by the login interface (when the login interface code=101).
*@param BCSkipPasswordModifyHandlerBlock: Asynchronous result callback
code=0 success, code=others indicates failure
**/
-(void)skipPassWordModifyWithStateToken:(NSString*)state_token andWithCallBackHandler:(BCSkipPasswordModifyHandlerBlock)callBack;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Return Parameters:

Code Description
code=0 Success data returns NSDictionary: data=@{@"session_token":sessionToken content,@"id_token":idToken content};
code=Others data=Failure description

# Modify Password

Code Example:

// Import header
#import <AuthnCenter_PWLogin_2E/BCPWPassWordUpdateManager.h>

// Click (trigger) login button
[[BCPWPassWordUpdateManager sharedInstance] modifyPasswordWithStateToken:_state_token andWithNewPassword:nePass andWithOldPassword:oldPass andWithCallBackHandler:^(NSString * _Nonnull code, id  _Nonnull data) {
        NSString* str=[NSString stringWithFormat:@"code=%@-----data=%@",code,data];
        


    }];
1
2
3
4
5
6
7
8
9
10

Introduction to BCPWPassWordUpdateManager Object Methods:

/**
  * Function name: sharedInstance
   * @param None
   * @return Singleton object instance class
 */
+ (instancetype )sharedInstance ;

/**
* Function name: modifyPasswordWithStateToken
* @brief: Skip password modification, only for use when the login interface returns status: " PASSWORD_EXPIRED " (when the login interface code=101)
*@ param state_token The state_token field returned by the login interface.
*@param newPassword
*@param oldPassword
*@param BCPWModifyPasswordHandlerBlock: Asynchronous result callback
code=0 success, code=others indicates failure
**/

-(void)modifyPasswordWithStateToken:(NSString*)state_token andWithNewPassword:(NSString*)newPassword andWithOldPassword:(NSString*)oldPassword andWithCallBackHandler:(BCPWModifyPasswordHandlerBlock)callBack;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Return Parameters:

Code Description
code=0 Success data returns an NSDictionary: data=@{@"session_token":sessionToken content,@"id_token":idToken content};
code=Other data=Failure description

# Retrieve Password via Mobile Number

The App client needs to build its own interface, including a mobile number input field, a button to get the verification code, a verification code input field, a new password input field, and a submit button. After clicking "Get Verification Code", please call the slider verification method to obtain the verification code described in this document.

// Import the request header
#import <AuthnCenter_PWLogin_2E/BCPWForgetPassWordManager.h>

// Click (trigger) the event to send the verification code
[[BCPWForgetPassWordManager sharedInstance] forgetPasswordChangePassWordByPhone:mobile andVerifyCode:verifyC andWithNewPassword:newPassword andWithCompletionHandler:^(NSString * _Nonnull code, id  _Nonnull data) {
        dispatch_async(dispatch_get_main_queue(), ^{
        NSString* str=[NSString stringWithFormat:@"code=%@------data=%@",code,data];
        });
        
    }];
1
2
3
4
5
6
7
8
9
10

Introduction to BCPWForgetPassWordManager object methods:

/**
  * Function name: sharedInstance
   * @param None
   * @return Singleton object instance class
 */
+ (instancetype )sharedInstance ;


/**
* Function name: forgetPasswordChangePassWordByPhone
* @brief: Retrieve password via mobile number
*@ param mobile phone number: Both with area code "+86-13800000000" or without area code "13800000000" are acceptable.
*@ param verifyCode SMS verification code
*@ param  newPassword New password
*@param complete: BCPWforgetPasswordModifyByPhoneHandlerBlock asynchronous result callback, code=0 password change successful, code=other indicates failure.
**/
-(void)forgetPasswordChangePassWordByPhone:(NSString*)mobile andVerifyCode:(NSString*)verifyCode andWithNewPassword:(NSString*)newPassword andWithCompletionHandler:(BCPWforgetPasswordModifyByPhoneHandlerBlock)callBack;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

Return Parameters:

Code Description
code=0 Success data=Success
code=Other data=Failure description

# Mobile Phone SMS Verification Code Registration {/mobile-phone-sms-verification-code-registration/}

Users build their own interface. Mobile phone number and verification code are required fields. IDaaS can be used. The SDK's slider verification sends SMS, and two methods are used to obtain the verification code. Other personal information parameters are optional. Registration success means login success, returning session_token and id_token.

Code Example:

// Import the request header
#import <AuthnCenter_SMSLogin_2E/BCPWRegistByPhoneNumManager.h>

// Click to register
  [[BCPWRegistManager sharedInstance] registUserByPhone:mobile andWithVerifyCode:verifyCode andWithUserName:username andWithName:name andWithEmail:email andWithPassword:password andWithHeadImageURLStr:headIma andWithGender:gender andWithBirthDay:birthDay andWithNickName:nickName andWithAddress:address andWithZipCode:zipCode andWithFirstName:FirstNAme andWithMiddleName:middleName andWithLastName:lastName andWithIndustry:industry andWithExtension:nil andWithCompletionHandler:^(NSString * _Nonnull code, id  _Nonnull data) {
   }];
1
2
3
4
5
6

Introduction to BCPWRegistManager Object Method:

/**
* Function Name: registUserByPhone
* @brief: Register a new user with a mobile phone number
*@ param mobile phone number (required): With country code "+86-13800000000" or without country code "13800000000" are both acceptable.
*@ param verifyCode (required): SMS verification code
*@param complete: BCPWRegistByPhoneHandlerBlock asynchronous result callback, code=0 success, data returns session_token and id_token, code=other indicates failure.
**/

-(void)registUserByPhone:(NSString*)mobile andWithVerifyCode:(NSString*)verifyCode andWithUserName:(NSString*)userName andWithName:(NSString*)name andWithEmail:(NSString*)email andWithPassword:(NSString*)password andWithHeadImageURLStr:(NSString*)headImageUrlStr andWithGender:(NSString*)gender andWithBirthDay:(NSString*)birthday andWithNickName:(NSString*)nickName andWithAddress:(NSString*)address andWithZipCode:(NSString*)zipCode andWithFirstName:(NSString*)firstName andWithMiddleName:(NSString*)middleName andWithLastName:(NSString*)lastName andWithIndustry:(NSString*)industry andWithExtension:(NSDictionary*)extendDic andWithCompletionHandler:(BCPWRegistByPhoneHandlerBlock)callBack;
1
2
3
4
5
6
7
8
9

Input Parameter Description:

Parameter Name Type Required Code Example
mobile NSString Yes With country code "+86-13800000000" or without country code "13800000000" are both acceptable
verifyCode NSString Yes Based on the verification code received via SMS
userName NSString No Username, English letters and numbers
name NSString No Chinese, English, numbers
email NSString No Email
password NSString No Password
headImageUrlStr NSString No Avatar URL address "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIQ8QOTSn3y4cYHLlMC3sv6RCBmeMkxtOog47Zr3v2Afbqc2bmP0WibUIUskX39eJlJ"
gender NSString No Optional values: female: female; male: male; unknow: confidential. This parameter will be format validated. If it does not match, the callback function will return an error
birthday NSString No Format: yyyy-MM-dd. This parameter will be format validated. If it does not match, the callback function will return an error
nickName NSString No Nickname, Chinese, English, numbers
address NSString No Address
zipCode NSString No Postal code
firstName NSString No First name
middleName NSString No Middle name
lastName NSString No Last name
industry NSString No Industry
extendDic NSDictionary No Pass additional parameters added in the backend in the following format, where age is the parameter name newly configured in the enterprise center. { "age":"18" }

Return Parameters:

code Description
code=0 Success Data returns NSDictionary: data= {"session_token":sessionToken content,"id_token":idToken content};
code=Other data=Failure description

param Input Parameter Example:

{
  "user_name": "zhangsan",
  "name": "张三",
  "email": "15200000000@qq.com",
  "pwd": "QWE@qwe123",
  "head_img": "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIQ8QOTSn3y4cYHLlMC3sv6RCBmeMkxtOog47Zr3v2Afbqc2bmP0WibUIUskX39eJlJ",
  "attr_gender":"male",
  "attr_birthday": "2022-02-17",
  "attr_nick_name": "张三",
  "mailing_address": "湖北省武汉市",
  "zip_code": "430000",
  "first_name": "zhangsan",
  "middle_name": "zhangsan",
  "last_name": "zhangsan",
  "industry": "事业单位",
  "extension": {
    "age":"18"
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# IDToken Verification and Obtaining User Information

After successful login, session_token and id_token will be returned. The id_token can be used to obtain user information and verify login validity.

Process: Obtain user information from the idtoken (this method can be called directly without verification).

# Parse User Information from idToken

Call Example:

[[BCIDAIDTokenManager sharedInstance] getUserInfoFromIdTokenWithIdToken:idToken andWithCallBack:^(NSString * _Nonnull code, id  _Nonnull data) {
            
}];
1
2
3

Main Class BCIDAIDTokenManager Introduction:

/**
   * Function name: sharedInstance
   * @param No input parameters
   * @return Returns the singleton instance of the object
*/
+ (instancetype )sharedInstance;

/**
* Function name: getUserInfoFromIdTokenWithIdToken
* @brief: Parse user information from idToken
* @param idToken returned from login
* @param BCIDAIdTokenGetInfoHandlerBlock callback function:
NSString code
id       data

**/
-(void)getUserInfoFromIdTokenWithIdToken:(NSString*)idToken andWithCallBack:(BCIDAIdTokenGetInfoHandlerBlock)callback;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

User Information Parameter Description:

Parameter Name Description
iss Token Issuer
aud Token Audience, the clientId of the application
exp Token Expiration Time
jti Token ID
iat Token Issuance Time
sub Fixed as subject
name User's Full Name
mobile User's Mobile Number
id User's ID
userName Username
email User's Email

Callback Function Return Values:

Success Example:
code=0
data=
{
	"id": "20220729174957176-2C7F-A2C54C293",
	"exp": 1659407592,
	"nbf": 1659407172,
	"mobile": "+86-13808603636",
	"jti": "7iwCYPo8EYcmLAD18x-CAw",
	"iss": "https:\/\/sdk2c.idaas-test-alpha.bccastle.com\/api\/v1\/oauth2",
	"userName": "zhangrui1",
	"sub": "20220729174957176-2C7F-A2C54C293",
	"aud": "S1ScicdIVR1QUbNs8TBz6BYVd2Zt8Adc",
	"iat": 1659407292,
	"email": "",
	"name": "zhangrui1"
}

Failure Example
code=102
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# Refresh IDToken

Call Example:

[[BCIDAIDTokenRefreshManager sharedInstance] refreshIdTokenWithSessionToken:sessionToken andWithCallBack:^(NSString * _Nonnull code, id  _Nonnull data) {
            NSString* jsonS=(NSString*)data;
         NSDictionary* dict=  [self dictionaryWithJsonString:jsonS];//Parse jsonStr to NSDictionary
          NSString* idTok= [dict objectForKey:@"id_token"];
            NSString* session_tok=[dict objectForKey:@"session_token"];
            NSString* expr=[dict objectForKey:@"expire"];
                  }];
1
2
3
4
5
6
7

Introduction to Main Class BCIDAIDTokenManager:

/**
   * Function Name: sharedInstance
   * @param No input parameters
   * @return Returns the singleton instance of the object
*/
+ (instancetype )sharedInstance;

/**
* Function Name: refreshIdTokenWithSessionToken
* @brief: Refresh idToken
* @param sessionToken returned from login
* @param BCIDAIdTokenRefreshIDTokenHandlerBlock Callback function:
NSString code
id       data

**/
-(void)refreshIdTokenWithSessionToken:(NSString*)sessionToken andWithCallBack:(BCIDAIdTokenRefreshIDTokenHandlerBlock)callBack;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

Callback Function Return Values:

Success Example:
code=0
data=
{
  "id_token" : "eyJraWQiOiJhODJkzJjLmlkYWFzLXRllKp6w",
  "session_token" : "apcOKuyry7kASh9h6mtf2G2GbettkyiU",
  "expire" : 7200
}

Failure Example (Failed to retrieve data)
code=1
1
2
3
4
5
6
7
8
9
10
11

# Return Codes

Status Code Error Code (error_code) Error Description (error_msg) Handling Measures
400 IDAAS.SDK.COMMON.1001 Parameter {0} cannot be left blank
Parameter {0} cannot be empty
400 IDAAS.SDK.COMMON.1002 The {0} parameter format is incorrect
Parameter {0} format is incorrect
400 IDAAS.SDK.COMMON.1003 Device information is incomplete
Device information is incomplete
400 IDAAS.SDK.COMMON.1004 Signature decryption error
Signature decryption error
400 IDAAS.SDK.COMMON.1005 The {0} has failed
{0} has expired
400 IDAAS.SDK.COMMON.1006 The {0} parameter error
{0} parameter error
400 IDAAS.SDK.COMMON.1007 The {0} parameter type error
{0} parameter type error
500 IDAAS.SDK.COMMON.1008 The system is busy. Try again later
System is busy. Please try again later
400 IDAAS.SDK.COMMON.1009 Unknown authentication configuration
Unknown authentication configuration
400 IDAAS.SDK.COMMON.1010 Failed to obtain the enterprise center global configuration
Failed to obtain enterprise center global configuration
400 IDAAS.SDK.COMMON.1011 Failed to obtain the international area code configuration
Failed to obtain international area code configuration
400 IDAAS.SDK.COMMON.1012 The x-client-ID is incorrect and the corresponding application cannot be found
X-client-id is incorrect, cannot find the corresponding application
400 IDAAS.SDK.COMMON.1013 The corresponding user is not found
Corresponding user not found
400 IDAAS.SDK.COMMON.1014 Application private key not found
Application private key not found
400 IDAAS.SDK.LOGIN.1001 Error calling interface {0}
Error calling interface {0}
400 IDAAS.SDK.LOGIN.1002 User not bound
User not bound
400 IDAAS.SDK.LOGIN.1003 The user has been locked due to too many unsuccessful login attempts. It will be unlocked in {0} minutes and {1} seconds
The user has been locked due to too many failed login attempts. It will be unlocked in {0} minutes and {1} seconds
400 IDAAS.SDK.LOGIN.1004 Failed to obtain the password policy
Failed to obtain password policy
400 IDAAS.SDK.LOGIN.1005 Invalid username or password. Remaining login attempts: {0}
Invalid username or password. Remaining login attempts: {0}
400 IDAAS.SDK.LOGIN.1006 Configuration error, unable to find wechat authentication source
Configuration error, unable to find WeChat authentication source
400 IDAAS.SDK.LOGIN.1007 Configuration error, unable to find alipay authentication source
Configuration error, unable to find Alipay authentication source
400 IDAAS.SDK.LOGIN.1008 The configuration is incorrect. The one-click login authentication source cannot be found
Configuration error, unable to find one-click login authentication source
400 IDAAS.SDK.SMS.1001 {0} slide base map is not initialized successfully, please check the path
{0} slide base map not initialized successfully, please check the path
400 IDAAS.SDK.SMS.1002 {0} verification code coordinate resolution failed
{0} verification code coordinate resolution failed
400 IDAAS.SDK.SMS.1003 {0} verification code coordinate verification fails
{0} verification code coordinate verification failed
400 IDAAS.SDK.SMS.1004 The graphic verification code is incorrect
Graphic verification code verification error
400 IDAAS.SDK.SMS.1005 SMS verification code verification is incorrect
SMS verification code verification error
400 IDAAS.SDK.SMS.1006 The email verification code is incorrect
Email verification code verification error
400 IDAAS.SDK.SMS.1007 Sending scenario does not exist
Sending scenario does not exist
400 IDAAS.SDK.SMS.1008 Failed to send the verification code
Failed to send verification code
400 IDAAS.SDK.SOCIAL.1001 The social account is unbound incorrectly
Social account unbinding error
400 IDAAS.SDK.SOCIAL.1002 The social account has been bound, please unbind it first
Social account is already bound, please unbind first
400 IDAAS.SDK.PWD.1001 The password length is incorrect
Password length error
400 IDAAS.SDK.PWD.1002 The password cannot be the username
Password cannot be the username
400 IDAAS.SDK.PWD.1003 Your password complexity is low
Your password complexity is low
400 IDAAS.SDK.PWD.1004 The password is weak
Password is weak
400 IDAAS.SDK.PWD.1005 The password is used before, cannot be used again
This password has been used before and cannot be used again
400 IDAAS.SDK.PWD.1006 Password cannot username in reverse order
Password cannot be the reverse order of the username
400 IDAAS.SDK.PWD.1007 The number of repeated password characters exceeded the upper limit
Number of repeated password characters exceeds limit
400 IDAAS.SDK.PWD.1008 Password cannot contain :username, phone number, email prefix, name in PinYing
Password cannot contain: username, phone number, email prefix, name in Pinyin
400 IDAAS.SDK.MFA.1001 The mobile doesn't match the user
Mobile number does not match the user
400 IDAAS.SDK.MFA.1002 The access control policy is incorrect
Access control policy configuration error
400 IDAAS.SDK.MFA.1003 Access control authentication source type conversion error
Access control authentication source type conversion error

I am ready to receive the Markdown content. Please paste the text you need translated.