Membuat aturan otentikasi gerbang.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mse:AddGatewayAuth |
create |
*Gateway
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
No |
Nama otentikasi. |
test |
| Type |
string |
No |
Metode autentikasi. Nilai valid:
|
JWT |
| Issuer |
string |
No |
Parameter ini berlaku ketika
|
https://example.com/auth |
| Jwks |
string |
No |
Kunci publik JWT dalam format JSON Web Key Set (JWKS). |
{"keys":[{"e":"AQAB","kid":"DHFbpoIUqrY8t2zpA2qXfCmr5VO5ZEr4RzHU_-envvQ","kty":"RSA","n":"xAE7eB6qugXyCAG3yhh7pkDkT65pHymX-P7KfIupjf59vsdo91bSP9C8H07pSAGQO1MV_xFj9VswgsCg4R6otmg5PV2He95lZdHtOcU5DXIg_pbhLdKXbi66GlVeK6ABZOUW3WYtnNHD-91gVuoeJT_DwtGGcp4ignkgXfkiEm4sw-4sfb4qdt5oLbyVpmW6x9cfa7vs2WTfURiCrBoUqgBo_-4WTiULmmHSGZHOjzwa8WtrtOQGsAFjIbno85jp6MnGGGZPYZbDAa_b3y5u-YpW7ypZrvD8BgtKVjgtQgZhLAGezMt0ua3DRrWnKqTZ0BJ_EyxOGuHJrLsn00fnMQ"}]} |
| TokenPosition |
string |
No |
Menentukan lokasi JWT. Nilai valid:
Secara default, token dibaca dari header |
HEADER |
| TokenName |
string |
No |
Nama header permintaan yang berisi JWT. Nilai default adalah |
Authorization |
| TokenNamePrefix |
string |
No |
Awalan untuk nilai token di header. Nilai default adalah |
Bearer |
| TokenPass |
boolean |
No |
Apakah akan meneruskan token ke layanan backend setelah otentikasi berhasil. |
true |
| IsWhite |
boolean |
No |
Menentukan mode otorisasi.
|
true |
| Status |
boolean |
No |
Parameter ini untuk penggunaan internal dan tidak boleh dikonfigurasi. Saat dibuat, aturan otentikasi dinonaktifkan secara default. |
false |
| RedirectUrl |
string |
No |
URL tempat pengguna dialihkan setelah otentikasi berhasil. Parameter ini diperlukan ketika |
https://test-.com/oauth2/callback |
| ClientId |
string |
No |
ID klien aplikasi yang terdaftar pada penyedia identitas. Parameter ini diperlukan ketika |
23460e2fdd9bf9ad106**** |
| ClientSecret |
string |
No |
Rahasia klien aplikasi yang terdaftar pada penyedia identitas. Parameter ini diperlukan ketika |
123**** |
| CookieDomain |
string |
No |
Domain cookie. Setelah otentikasi berhasil, gerbang mengirim cookie ke domain ini untuk menjaga pengguna tetap masuk. Misalnya, jika Anda menetapkan |
test.com |
| ScopesList |
array |
No |
Cakupan (dalam OAuth) OIDC. Parameter ini diperlukan ketika |
|
|
string |
No |
An OIDC scope. |
openid |
|
| LoginUrl |
string |
No |
URL halaman masuk pengguna untuk instans IDaaS. Parameter ini diperlukan ketika |
https://daxxxxcn.aliyunidaas.com/ |
| Sub |
string |
No |
Subjek ( |
testing@secure.istio.io |
| ExternalAuthZJSON |
object |
No |
Pengaturan untuk layanan otentikasi kustom. |
|
| ServiceId |
integer |
No |
The ID of the authentication service. |
1343 |
| PrefixPath |
string |
No |
The path of the authentication API provided by the authentication service. The path is matched by prefix. |
/auth |
| TokenKey |
string |
No |
The request header that contains the token, such as |
Authorization |
| AllowRequestHeaders |
array |
No |
The request headers to pass to the custom authentication service. |
|
|
string |
No |
The name of an allowed request header. |
x-req |
|
| AllowUpstreamHeaders |
array |
No |
The response headers from the custom authentication service to pass to the backend service. |
|
|
string |
No |
The name of an allowed response header. |
x-resp |
|
| Timeout |
integer |
No |
The timeout for the custom authentication service, in seconds. |
10 |
| IsRestrict |
boolean |
No |
Specifies the behavior when the custom authentication service is unavailable:
|
true |
| WithRequestBody |
boolean |
No |
Specifies whether to include the request body in the request sent to the custom authentication service. |
true |
| BodyMaxBytes |
integer |
No |
The maximum size of the request body that can be sent to the custom authentication service, in bytes. |
4000000 |
| WithRematchRoute |
boolean |
No |
Specifies whether to rematch the route after the authentication is complete. |
|
| GatewayUniqueId |
string |
No |
ID unik gerbang. |
gw-*****9b04bb4474cae9d645be850e3d7 |
| AuthResourceMode |
integer |
No |
Mode untuk mengonfigurasi Sumber daya otorisasi. Nilai valid:
|
1 |
| AuthResourceConfig |
string |
No |
Konfigurasi YAML untuk mode lanjutan. |
|
| AuthResourceList |
array<object> |
No |
Daftar aturan otorisasi. Beberapa aturan dievaluasi dengan logika OR. Dalam satu aturan, beberapa kondisi pencocokan dievaluasi dengan logika AND. |
|
|
array<object> |
No |
The settings for an authorization rule. |
||
| DomainId |
integer |
No |
The ID of the domain name to which the rule applies. |
1765 |
| Path |
string |
No |
The request path to match. |
/test |
| MatchType |
string |
No |
The match type for the path. Valid values:
|
EQUAL |
| IgnoreCase |
boolean |
No |
Specifies whether path matching is case-sensitive. This parameter is applicable only to custom authentication rules. For other authentication methods, path matching is case-sensitive by default.
|
true |
| AuthResourceHeaderList |
array<object> |
No |
A list of request header conditions to match. This parameter is applicable only to custom authentication rules. |
|
|
object |
No |
|||
| HeaderKey |
string |
No |
The name of the request header. |
x-req |
| HeaderMethod |
string |
No |
The match condition. Valid values:
|
EQUAL |
| HeaderValue |
string |
No |
The value of the request header. |
123 |
| AcceptLanguage |
string |
No |
Bahasa tanggapan. Nilai valid: |
zh |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The data structure. |
||
| RequestId |
string |
The request ID. |
4279C00F-A5E1-53C6-A43B-751C1C524D0B |
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| Message |
string |
The response message. |
OK |
| Code |
integer |
The response code. A value of |
200 |
| Success |
boolean |
Indicates whether the request succeeded. Valid values:
|
true |
| Data |
integer |
The ID of the created authentication rule. |
333 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "4279C00F-A5E1-53C6-A43B-751C1C524D0B",
"HttpStatusCode": 200,
"Message": "OK",
"Code": 200,
"Success": true,
"Data": 333
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | |
| 400 | InvalidParameter | Parameter error:%s | |
| 500 | InternalError | Console error. Try again later:%s | |
| 403 | NoPermission | You are not authorized to perform this operation:%s | |
| 404 | NotFound | Not found:%s |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.