auth
Auth
Bases: Resource
Source code in nylas/resources/auth.py
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 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
|
grants: Grants
property
Access the Grants API.
Returns:
Type | Description |
---|---|
Grants
|
The Grants API. |
detect_provider(params)
Detect provider from email address.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
ProviderDetectParams
|
The parameters to include in the request |
required |
Returns:
Type | Description |
---|---|
Response[ProviderDetectResponse]
|
The detected provider, if found. |
Source code in nylas/resources/auth.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
exchange_code_for_token(request)
Exchange an authorization code for an access token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
CodeExchangeRequest
|
The request parameters for the code exchange |
required |
Returns:
Type | Description |
---|---|
CodeExchangeResponse
|
Information about the Nylas application |
Source code in nylas/resources/auth.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
id_token_info(id_token)
Get info about an ID token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_token |
str
|
The ID token to query. |
required |
Returns:
Type | Description |
---|---|
TokenInfoResponse
|
The API response with the token information. |
Source code in nylas/resources/auth.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
refresh_access_token(request)
Refresh an access token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
TokenExchangeRequest
|
The refresh token request. |
required |
Returns:
Type | Description |
---|---|
CodeExchangeResponse
|
The response containing the new access token. |
Source code in nylas/resources/auth.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
revoke(token)
Revoke a single access token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token |
str
|
The access token to revoke. |
required |
Returns:
Name | Type | Description |
---|---|---|
True |
True
|
If the token was revoked successfully. |
Source code in nylas/resources/auth.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
url_for_admin_consent(config)
Build the URL for admin consent authentication for Microsoft.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
URLForAdminConsentConfig
|
The configuration for the authentication request. |
required |
Returns:
Type | Description |
---|---|
str
|
The URL for hosted authentication. |
Source code in nylas/resources/auth.py
173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
url_for_oauth2(config)
Build the URL for authenticating users to your application via Hosted Authentication.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
URLForAuthenticationConfig
|
The configuration for building the URL. |
required |
Returns:
Type | Description |
---|---|
str
|
The URL for hosted authentication. |
Source code in nylas/resources/auth.py
71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
url_for_oauth2_pkce(config)
Build the URL for authenticating users to your application via Hosted Authentication with PKCE.
IMPORTANT: YOU WILL NEED TO STORE THE 'secret' returned to use it inside the CodeExchange flow
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
URLForAuthenticationConfig
|
The configuration for the authentication request. |
required |
Returns:
Type | Description |
---|---|
PkceAuthUrl
|
The URL for hosted authentication with secret & hashed secret. |
Source code in nylas/resources/auth.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
validate_access_token(access_token)
Get info about an access token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
access_token |
str
|
The access token to query. |
required |
Returns:
Type | Description |
---|---|
TokenInfoResponse
|
The API response with the token information. |
Source code in nylas/resources/auth.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|