Authentication
Auth
¶
Bases: ABC
Base class for Salesforce authentication.
Source code in src/aiosalesforce/auth/base.py
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
expired: bool
property
¶
True if the access token is expired.
get_access_token(client)
async
¶
Get access token.
If this is the first time this method is called, it will acquire a new access token from Salesforce.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client |
Salesforce
|
Salesforce client. |
required |
Returns:
Type | Description |
---|---|
str
|
Access token |
Source code in src/aiosalesforce/auth/base.py
refresh_access_token(client)
async
¶
Refresh the access token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client |
Salesforce
|
Salesforce client. |
required |
Returns:
Type | Description |
---|---|
str
|
Access token |
Source code in src/aiosalesforce/auth/base.py
SoapLogin
¶
Bases: Auth
Authenticate using the SOAP login method.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_login.htm
Parameters:
Name | Type | Description | Default |
---|---|---|---|
username |
str
|
Username. |
required |
password |
str
|
Password. |
required |
security_token |
str
|
Security token. |
required |
Source code in src/aiosalesforce/auth/soap.py
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
ClientCredentialsFlow
¶
Bases: Auth
Authenticate using the OAuth 2.0 Client Credentials Flow.
https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_client_credentials_flow.htm&type=5
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client_id |
str
|
Client ID. |
required |
client_secret |
str
|
Client secret. |
required |
timeout |
float
|
Timeout for the access token in seconds. By default assumed to never expire. |
None
|