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
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
|
<?php return [
'version' => '1.0',
'info' => [
'style' => 'RPC',
'product' => 'Sts',
'version' => '2015-04-01',
],
'directories' => [
[
'id' => 120773,
'title' => 'Role assuming',
'type' => 'directory',
'children' => [
'AssumeRole',
'AssumeRoleWithSAML',
'AssumeRoleWithOIDC',
],
],
[
'id' => 120777,
'title' => 'Requester identity',
'type' => 'directory',
'children' => [
'GetCallerIdentity',
],
],
],
'components' => [
'schemas' => [],
],
'apis' => [
'AssumeRole' => [
'summary' => 'Obtains a Security Token Service (STS) token to assume a Resource Access Management (RAM) role.',
'methods' => [
'post',
'get',
],
'schemes' => [
'https',
],
'security' => [
[
'AK' => [],
],
],
'operationType' => 'readAndWrite',
'systemTags' => [
'operationType' => 'get',
'riskType' => 'high',
'chargeType' => 'free',
],
'parameters' => [
[
'name' => 'DurationSeconds',
'in' => 'query',
'schema' => [
'description' => 'The validity period of the STS token. Unit: seconds.'."\n"
."\n"
.'Minimum value: 900. Maximum value: the value of the `MaxSessionDuration` parameter. Default value: 3600.'."\n"
."\n"
.'You can call the CreateRole or UpdateRole operation to configure the `MaxSessionDuration` parameter. For more information, see [CreateRole](~~28710~~) or [UpdateRole](~~28712~~).'."\n",
'type' => 'integer',
'format' => 'int64',
'required' => false,
'example' => '3600',
],
],
[
'name' => 'Policy',
'in' => 'query',
'schema' => [
'description' => 'The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role.'."\n"
."\n"
.'* If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role.'."\n"
.'* If you do not specify this parameter, the returned STS token has all the permissions of the RAM role.'."\n"
."\n"
.'The value must be 1 to 2,048 characters in length.'."\n"
."\n"
.'For more information about policy elements and sample policies, see [Policy elements](~~93738~~) and [Overview of sample policies](~~210969~~).'."\n",
'type' => 'string',
'required' => false,
'example' => '{"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"}',
],
],
[
'name' => 'RoleArn',
'in' => 'query',
'schema' => [
'description' => 'The Alibaba Cloud Resource Name (ARN) of the RAM role.'."\n"
."\n"
.'The trusted entity of the RAM role is an Alibaba Cloud account. For more information, see [Create a RAM role for a trusted Alibaba Cloud account](~~93691~~) or [CreateRole](~~28710~~).'."\n"
."\n"
.'Format: `acs:ram::<account_id>:role/<role_name>`.'."\n"
."\n"
.'You can view the ARN in the RAM console or by calling operations. The following items describe the validity periods of storage addresses:'."\n"
."\n"
.'* For more information about how to view the ARN in the RAM console, see [How do I find the ARN of the RAM role?](~~39744~~)'."\n"
.'* For more information about how to view the ARN by calling operations, see [ListRoles](~~28713~~) or [GetRole](~~28711~~).'."\n",
'type' => 'string',
'required' => true,
'example' => 'acs:ram::123456789012****:role/adminrole',
],
],
[
'name' => 'RoleSessionName',
'in' => 'query',
'schema' => [
'description' => 'The custom name of the role session.'."\n"
."\n"
.'Set this parameter based on your business requirements. In most cases, you can set this parameter to the identity of the API caller. For example, you can specify a username. You can specify `RoleSessionName` to identify API callers that assume the same RAM role in ActionTrail logs. This allows you to track the users that perform the operations.'."\n"
."\n"
.'The value must be 2 to 64 characters in length and can contain letters, digits, and the following special characters: `. @ - _`.'."\n",
'type' => 'string',
'required' => true,
'example' => 'alice',
],
],
[
'name' => 'ExternalId',
'in' => 'query',
'schema' => [
'description' => 'The external ID of the RAM role.'."\n"
."\n"
.'This parameter is provided by an external party and is used to prevent the confused deputy problem. For more information, see [Use ExternalId to prevent the confused deputy problem](~~2361741~~).'."\n"
."\n"
.'The value must be 2 to 1,224 characters in length and can contain letters, digits, and the following special characters: `= , . @ : / - _`. The regular expression for this parameter is `[\\w+=,.@:\\/-]*`.'."\n",
'type' => 'string',
'required' => false,
'example' => 'abcd1234',
],
],
[
'name' => 'SourceIdentity',
'in' => 'query',
'schema' => [
'type' => 'string',
],
],
],
'responses' => [
200 => [
'headers' => [],
'schema' => [
'description' => 'The response parameters.'."\n",
'type' => 'object',
'properties' => [
'RequestId' => [
'description' => 'The ID of the request.'."\n",
'type' => 'string',
'example' => '6894B13B-6D71-4EF5-88FA-F32781734A7F',
],
'AssumedRoleUser' => [
'description' => 'The temporary identity that you use to assume the RAM role.'."\n",
'type' => 'object',
'properties' => [
'AssumedRoleId' => [
'description' => 'The ID of the temporary identity that you use to assume the RAM role.'."\n",
'type' => 'string',
'example' => '34458433936495****:alice',
],
'Arn' => [
'description' => 'The ARN of the temporary identity that you use to assume the RAM role.'."\n",
'type' => 'string',
'example' => 'acs:ram::123456789012****:role/adminrole/alice',
],
],
],
'Credentials' => [
'description' => 'The STS credentials.'."\n",
'type' => 'object',
'properties' => [
'SecurityToken' => [
'description' => 'The STS token.'."\n"
."\n"
.'> Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens.'."\n",
'type' => 'string',
'example' => '********',
],
'Expiration' => [
'description' => 'The time when the STS token expires. The time is displayed in UTC.'."\n",
'type' => 'string',
'example' => '2015-04-09T11:52:19Z',
],
'AccessKeySecret' => [
'description' => 'The AccessKey secret.'."\n",
'type' => 'string',
'example' => 'wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK****',
],
'AccessKeyId' => [
'description' => 'The AccessKey ID.'."\n",
'type' => 'string',
'example' => 'STS.L4aBSCSJVMuKg5U1****',
],
],
],
'SourceIdentity' => [
'type' => 'string',
],
],
],
],
],
'errorCodes' => [
400 => [
[
'errorCode' => 'InvalidParameter.DurationSeconds',
'errorMessage' => 'The Min/Max value of DurationSeconds is 15min/1hr.',
],
[
'errorCode' => 'InvalidParameter.ExternalId',
'errorMessage' => 'The parameter ExternalId is wrongly formed.',
],
[
'errorCode' => 'InvalidParameter.RoleArn',
'errorMessage' => 'The parameter RoleArn is wrongly formed.',
],
[
'errorCode' => 'InvalidParameter.RoleSessionName',
'errorMessage' => 'The parameter RoleSessionName is wrongly formed.',
],
[
'errorCode' => 'InvalidParameter.SerialNumber',
'errorMessage' => 'The parameter SerialNumber is wrongly formed.',
],
[
'errorCode' => 'InvalidParameter.TokenCode',
'errorMessage' => 'The parameter TokenCode is wrongly formed.',
],
[
'errorCode' => 'InvalidParameter.PolicyGrammar',
'errorMessage' => 'The parameter Policy has not passed grammar check.',
],
[
'errorCode' => 'InvalidParameter.PolicySize',
'errorMessage' => 'The size of Policy must be smaller than 2048 bytes.',
],
[
'errorCode' => 'InvalidParameter.ContentType',
'errorMessage' => 'The ContentType request header must be either "application/json" or "application/x-www-form-urlencoded".',
],
],
403 => [
[
'errorCode' => 'NoPermission',
'errorMessage' => 'You are not authorized to do this action. You should be authorized by RAM.',
],
[
'errorCode' => 'AuthenticationFail.ApiUsername',
'errorMessage' => 'The specified api username is not legal.',
],
[
'errorCode' => 'AuthenticationFail.ApiPassword',
'errorMessage' => 'The specified api password is not legal.',
],
],
[
[
'errorCode' => 'EntityNotExist.Role',
'errorMessage' => 'The specified Role not exists .',
],
],
500 => [
[
'errorCode' => 'InternalError',
'errorMessage' => 'STS Server Internal Error happened, please send the RequestId to us.',
],
],
],
'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"6894B13B-6D71-4EF5-88FA-F32781734A7F\\",\\n \\"AssumedRoleUser\\": {\\n \\"AssumedRoleId\\": \\"34458433936495****:alice\\",\\n \\"Arn\\": \\"acs:ram::123456789012****:role/adminrole/alice\\"\\n },\\n \\"Credentials\\": {\\n \\"SecurityToken\\": \\"********\\",\\n \\"Expiration\\": \\"2015-04-09T11:52:19Z\\",\\n \\"AccessKeySecret\\": \\"wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK****\\",\\n \\"AccessKeyId\\": \\"STS.L4aBSCSJVMuKg5U1****\\"\\n },\\n \\"SourceIdentity\\": \\"Alice\\"\\n}","errorExample":""},{"type":"xml","example":"<AssumeRoleResponse>\\n <Credentials>\\n <AccessKeyId>STS.L4aBSCSJVMuKg5U1****</AccessKeyId>\\n <AccessKeySecret>wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK****</AccessKeySecret>\\n <Expiration>2015-04-09T11:52:19Z</Expiration>\\n <SecurityToken>********</SecurityToken>\\n </Credentials>\\n <AssumedRoleUser>\\n <Arn>acs:ram::123456789012****:role/adminrole/alice</Arn>\\n <AssumedRoleId>34458433936495****:alice</AssumedRoleId>\\n </AssumedRoleUser>\\n <RequestId>6894B13B-6D71-4EF5-88FA-F32781734A7F</RequestId>\\n</AssumeRoleResponse>","errorExample":""}]',
'title' => 'AssumeRole',
'description' => '### Prerequisites'."\n"
."\n"
.'You cannot use an Alibaba Cloud account to call this operation. The requester of this operation can only be a RAM user or RAM role. Make sure that the AliyunSTSAssumeRoleAccess policy is attached to the requester. After this policy is attached to the requester, the requester has the management permissions on STS.'."\n"
."\n"
.'If you do not attach the AliyunSTSAssumeRoleAccess policy to the requester, the following error message is returned:'."\n"
."\n"
.'`You are not authorized to do this action. You should be authorized by RAM.`'."\n"
."\n"
.'You can refer to the following information to troubleshoot the error:'."\n"
."\n"
.'* Cause of the error: The policy that is required to assume a RAM role is not attached to the requester. To resolve this issue, attach the AliyunSTSAssumeRoleAccess policy or a custom policy to the requester. For more information, see [Can I specify the RAM role that a RAM user can assume?](~~39744~~) and [Grant permissions to a RAM user](~~116146~~).'."\n"
.'* Cause of the error: The requester is not authorized to assume the RAM role. To resolve this issue, add the requester to the Principal element in the trust policy of the RAM role For more information, see [Edit the trust policy of a RAM role](~~116819~~).'."\n"
."\n"
.'### Best practices'."\n"
."\n"
.'An STS token is valid for a period of time after it is issued, and the number of STS tokens that can be issued within an interval is also limited. Therefore, we recommend that you configure a proper validity period for an STS token and repeatedly use the token within this period. This prevents frequent issuing of STS tokens from adversely affecting your services if a large number of requests are sent. For more information about the limit, see [Is the number of STS API requests limited?](~~39744~~) You can configure the `DurationSeconds` parameter to specify a validity period for an STS token.'."\n"
."\n"
.'When you upload or download Object Storage Service (OSS) objects on mobile devices, a large number of STS API requests are sent. In this case, repeated use of an STS token may not meet your business requirements. To avoid the limit on STS API requests from affecting access to OSS, you can **add a signature to the URL of an OSS object**. For more information, see [Add signatures to URLs](~~31952~~) and [Obtain signature information from the server and upload data to OSS](~~31926~~).'."\n",
'requestParamsDescription' => 'For more information about common request parameters, see [Common parameters](~~315526~~).'."\n",
],
'AssumeRoleWithSAML' => [
'summary' => 'Obtains a Security Token Service (STS) token to assume a Resource Access Management (RAM) role during role-based single sign-on (SSO) by using Security Assertion Markup Language (SAML).',
'methods' => [
'post',
'get',
],
'schemes' => [
'https',
],
'security' => [
[
'Anonymous' => [],
],
],
'operationType' => 'readAndWrite',
'systemTags' => [
'operationType' => 'get',
'riskType' => 'high',
'chargeType' => 'free',
],
'parameters' => [
[
'name' => 'SAMLProviderArn',
'in' => 'query',
'schema' => [
'description' => 'The Alibaba Cloud Resource Name (ARN) of the SAML IdP that is created in the RAM console.'."\n"
."\n"
.'Format: `acs:ram::<account_id>:saml-provider/<saml_provider_id>`.'."\n"
."\n"
.'You can view the ARN in the RAM console or by calling operations.'."\n"
."\n"
.'* For more information about how to view the ARN in the RAM console, see [How do I view the ARN of a RAM role?](~~116795~~)'."\n"
.'* For more information about how to view the ARN by calling operations, see [GetSAMLProvider](~~186833~~) or [ListSAMLProviders](~~186851~~).'."\n",
'type' => 'string',
'required' => false,
'docRequired' => true,
'example' => 'acs:ram::123456789012****:saml-provider/company1',
],
],
[
'name' => 'RoleArn',
'in' => 'query',
'schema' => [
'description' => 'The ARN of the RAM role.'."\n"
."\n"
.'The trust entity of the RAM role is a SAML IdP. For more information, see [Create a RAM role for a trusted IdP](~~116805~~) or [CreateRole](~~28710~~).'."\n"
."\n"
.'Format: `acs:ram::<account_id>:role/<role_name>`.'."\n"
."\n"
.'You can view the ARN in the RAM console or by calling operations.'."\n"
."\n"
.'* For more information about how to view the ARN in the RAM console, see [How do I view the ARN of the RAM role?](~~39744~~).'."\n"
.'* For more information about how to view the ARN by calling operations, see [ListRoles](~~28713~~) or [GetRole](~~28711~~).'."\n",
'type' => 'string',
'required' => false,
'docRequired' => true,
'example' => 'acs:ram::123456789012****:role/adminrole',
],
],
[
'name' => 'SAMLAssertion',
'in' => 'query',
'schema' => [
'description' => 'The Base64-encoded SAML assertion.'."\n"
."\n"
.'The value must be 4 to 100,000 characters in length.'."\n"
."\n"
.'> A complete SAML response rather than a single SAMLAssertion field must be retrieved from the external IdP.'."\n",
'type' => 'string',
'required' => false,
'docRequired' => true,
'example' => 'base64_encoded_saml_assertion',
],
],
[
'name' => 'Policy',
'in' => 'query',
'schema' => [
'description' => 'The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role.'."\n"
."\n"
.'* If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role.'."\n"
.'* If you do not specify this parameter, the returned STS token has all the permissions of the RAM role.'."\n"
."\n"
.'The value must be 1 to 2,048 characters in length.'."\n",
'type' => 'string',
'required' => false,
'example' => 'url_encoded_policy',
],
],
[
'name' => 'DurationSeconds',
'in' => 'query',
'schema' => [
'description' => 'The validity period of the STS token. Unit: seconds.'."\n"
."\n"
.'Minimum value: 900. Maximum value: the value of the `MaxSessionDuration` parameter. Default value: 3600.'."\n"
."\n"
.'You can call the CreateRole or UpdateRole operation to configure the `MaxSessionDuration` parameter. For more information, see [CreateRole](~~28710~~) or [UpdateRole](~~28712~~).'."\n",
'type' => 'integer',
'format' => 'int64',
'required' => false,
'example' => '3600',
],
],
],
'responses' => [
200 => [
'schema' => [
'description' => 'The response parameters.'."\n",
'type' => 'object',
'properties' => [
'RequestId' => [
'description' => 'The ID of the request.'."\n",
'type' => 'string',
'example' => '6894B13B-6D71-4EF5-88FA-F32781734A7F',
],
'SAMLAssertionInfo' => [
'description' => 'The information in the SAML assertion.'."\n",
'type' => 'object',
'properties' => [
'SubjectType' => [
'description' => 'The Format attribute of the `NameID` element in the SAML assertion. If the Format attribute is prefixed with `urn:oasis:names:tc:SAML:2.0:nameid-format:`, the prefix is not included in the value of this parameter. For example, if the value of the Format attribute is urn:oasis:names:tc:SAML:2.0:nameid-format:persistent/transient, the value of this parameter is `persistent/transient`.'."\n",
'type' => 'string',
'example' => 'persistent',
],
'Subject' => [
'description' => 'The value in the NameID sub-element of the `Subject` element in the SAML assertion.'."\n",
'type' => 'string',
'example' => '[email protected]',
],
'Issuer' => [
'description' => 'The value in the `Issuer` element in the SAML assertion.'."\n",
'type' => 'string',
'example' => 'http://example.com/adfs/services/trust',
],
'Recipient' => [
'description' => 'The `Recipient` attribute of the SubjectConfirmationData sub-element. SubjectConfirmationData is a sub-element of the `Subject` element in the SAML assertion.'."\n",
'type' => 'string',
'example' => 'https://signin.aliyun.com/saml-role/SSO',
],
],
],
'AssumedRoleUser' => [
'description' => 'The temporary identity that you use to assume the RAM role.'."\n",
'type' => 'object',
'properties' => [
'AssumedRoleId' => [
'description' => 'The ID of the temporary identity that you use to assume the RAM role.'."\n",
'type' => 'string',
'example' => '34458433936495****:alice',
],
'Arn' => [
'description' => 'The ARN of the temporary identity that you use to assume the RAM role.'."\n",
'type' => 'string',
'example' => 'acs:sts::123456789012****:assumed-role/AdminRole/alice',
],
],
],
'Credentials' => [
'description' => 'The STS credentials.'."\n",
'type' => 'object',
'properties' => [
'SecurityToken' => [
'description' => 'The STS token.'."\n"
."\n"
.'> Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens.'."\n",
'type' => 'string',
'example' => '********',
],
'Expiration' => [
'description' => 'The time when the STS token expires. The time is displayed in UTC.'."\n",
'type' => 'string',
'example' => '2015-04-09T11:52:19Z',
],
'AccessKeySecret' => [
'description' => 'The AccessKey secret.'."\n",
'type' => 'string',
'example' => 'wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK****',
],
'AccessKeyId' => [
'description' => 'The AccessKey ID.'."\n",
'type' => 'string',
'example' => 'STS.L4aBSCSJVMuKg5U1****',
],
],
],
'SourceIdentity' => [
'type' => 'string',
],
],
],
],
],
'errorCodes' => [
500 => [
[
'errorCode' => 'InternalError',
'errorMessage' => 'STS Server Internal Error happened, please send the RequestId to us.',
],
],
],
'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"6894B13B-6D71-4EF5-88FA-F32781734A7F\\",\\n \\"SAMLAssertionInfo\\": {\\n \\"SubjectType\\": \\"persistent\\",\\n \\"Subject\\": \\"[email protected]\\",\\n \\"Issuer\\": \\"http://example.com/adfs/services/trust\\",\\n \\"Recipient\\": \\"https://signin.aliyun.com/saml-role/SSO\\"\\n },\\n \\"AssumedRoleUser\\": {\\n \\"AssumedRoleId\\": \\"34458433936495****:alice\\",\\n \\"Arn\\": \\"acs:sts::123456789012****:assumed-role/AdminRole/alice\\"\\n },\\n \\"Credentials\\": {\\n \\"SecurityToken\\": \\"********\\",\\n \\"Expiration\\": \\"2015-04-09T11:52:19Z\\",\\n \\"AccessKeySecret\\": \\"wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK****\\",\\n \\"AccessKeyId\\": \\"STS.L4aBSCSJVMuKg5U1****\\"\\n },\\n \\"SourceIdentity\\": \\"Alice\\"\\n}","errorExample":""},{"type":"xml","example":"<AssumeRoleWithSAMLResponse>\\n <Credentials>\\n <AccessKeyId>STS.L4aBSCSJVMuKg5U1****</AccessKeyId>\\n <AccessKeySecret>wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pK****</AccessKeySecret>\\n <Expiration>2015-04-09T11:52:19Z</Expiration>\\n <SecurityToken>********</SecurityToken>\\n </Credentials>\\n <AssumedRoleUser>\\n <arn>acs:sts::1234567890123456:assumed-role/AdminRole/alice</arn>\\n <AssumedRoleId>34458433936495****:alice</AssumedRoleId>\\n </AssumedRoleUser>\\n <SAMLAssertionInfo>\\n <SubjectType>persistent</SubjectType>\\n <Subject>[email protected]</Subject>\\n <Recipient>https://signin.aliyun.com/saml-role/SSO</Recipient>\\n <Issuer>http://example.com/adfs/services/trust</Issuer>\\n </SAMLAssertionInfo>\\n <RequestId>6894B13B-6D71-4EF5-88FA-F32781734A7F</RequestId>\\n</AssumeRoleWithSAMLResponse>","errorExample":""}]',
'title' => 'AssumeRoleWithSAML',
'description' => '###'."\n"
."\n"
.'* A SAML response is obtained from an external identity provider (IdP).'."\n"
.'* A SAML IdP is created in the RAM console. For more information, see [Create a SAML IdP](~~116083~~) or [CreateSAMLProvider](~~186846~~).'."\n"
.'* A RAM role whose trusted entity is a SAML IdP is created in the RAM console. For more information, see [Create a RAM role for a trusted IdP](~~116805~~) or [CreateRole](~~28710~~).'."\n",
'requestParamsDescription' => '> Anonymous users can call the AssumeRoleWithSAML operation because authentication for this operation is performed based on SAML assertions. Therefore, you do not need to specify the following common request parameters: `Signature`, `SignatureMethod`, `SignatureVersion`, and `AccessKeyId`. For more information about common request parameters, see [Common request parameters](~~315526~~).'."\n",
],
'AssumeRoleWithOIDC' => [
'summary' => 'Queries a Security Token Service (STS) token to assume a Resource Access Management (RAM) role during role-based single sign-on (SSO) by using OpenID Connect (OIDC).',
'methods' => [
'get',
'post',
],
'schemes' => [
'https',
],
'security' => [
[
'ARS_OIDC' => [],
],
],
'operationType' => 'readAndWrite',
'deprecated' => false,
'systemTags' => [
'operationType' => 'get',
'riskType' => 'high',
'chargeType' => 'free',
],
'parameters' => [
[
'name' => 'OIDCProviderArn',
'in' => 'query',
'schema' => [
'title' => 'OIDC Provider的ARN',
'description' => 'The Alibaba Cloud Resource Name (ARN) of the OIDC IdP.'."\n"
."\n"
.'You can view the ARN in the RAM console or by calling operations.'."\n"
."\n"
.'* For more information about how to view the ARN in the RAM console, see [View the information about an OIDC IdP](~~327123~~).'."\n"
.'* For more information about how to view the ARN by calling operations, see [GetOIDCProvider](~~327126~~) or [ListOIDCProviders](~~327127~~).'."\n",
'type' => 'string',
'required' => false,
'docRequired' => true,
'example' => 'acs:ram::113511544585****:oidc-provider/TestOidcIdp',
],
],
[
'name' => 'RoleArn',
'in' => 'query',
'schema' => [
'title' => '需要扮演的角色的ARN',
'description' => 'The ARN of the RAM role.'."\n"
."\n"
.'You can view the ARN in the RAM console or by calling operations.'."\n"
."\n"
.'* For more information about how to view the ARN in the RAM console, see [How do I view the ARN of the RAM role?](~~39744~~)'."\n"
.'* For more information about how to view the ARN by calling operations, see [ListRoles](~~28713~~) or [GetRole](~~28711~~).'."\n",
'type' => 'string',
'required' => false,
'docRequired' => true,
'example' => 'acs:ram::113511544585****:role/testoidc',
],
],
[
'name' => 'OIDCToken',
'in' => 'query',
'schema' => [
'title' => 'OIDC的ID Token,需输入原始Token,无需Base64解码',
'description' => 'The OIDC token that is issued by the external IdP.'."\n"
."\n"
.'The OIDC token must be 4 to 20,000 characters in length.'."\n"
."\n"
.'> You must enter the original OIDC token. You do not need to enter the Base64-encoded OIDC token.'."\n",
'type' => 'string',
'required' => false,
'docRequired' => true,
'example' => 'eyJraWQiOiJKQzl3eHpyaHFKMGd0****',
],
],
[
'name' => 'Policy',
'in' => 'query',
'schema' => [
'title' => '权限策略。 生成STS Token时可以指定一个额外的权限策略,以进一步限制STS Token的权限。若不指定则返回的Token拥有指定角色的所有权限。',
'description' => 'The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role.'."\n"
."\n"
.'* If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role.'."\n"
.'* If you do not specify this parameter, the returned STS token has all the permissions of the RAM role.'."\n"
."\n"
.'The value must be 1 to 2,048 characters in length.'."\n",
'type' => 'string',
'required' => false,
'example' => '{"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"}',
],
],
[
'name' => 'DurationSeconds',
'in' => 'query',
'schema' => [
'title' => 'Session过期时间,单位为秒。',
'description' => 'The validity period of the STS token. Unit: seconds.'."\n"
."\n"
.'Default value: 3600. Minimum value: 900. Maximum value: the value of the `MaxSessionDuration` parameter.'."\n"
."\n"
.'For more information about how to specify `MaxSessionDuration`, see [CreateRole](~~28710~~) or [UpdateRole](~~28712~~).'."\n",
'type' => 'integer',
'format' => 'int64',
'required' => false,
'example' => '3600',
],
],
[
'name' => 'RoleSessionName',
'in' => 'query',
'schema' => [
'title' => '用户自定义参数。此参数用来区分不同的令牌,可用于用户级别的访问审计。',
'description' => 'The custom name of the role session.'."\n"
."\n"
.'Set this parameter based on your business requirements. In most cases, this parameter is set to the identity of the user who calls the operation, for example, the username. In ActionTrail logs, you can distinguish the users who assume the same RAM role to perform operations based on the value of the RoleSessionName parameter. This way, you can perform user-specific auditing.'."\n"
."\n"
.'The value can contain letters, digits, periods (.), at signs (@), hyphens (-), and underscores (\\_).'."\n"
."\n"
.'The value must be 2 to 64 characters in length.'."\n",
'type' => 'string',
'required' => true,
'docRequired' => true,
'example' => 'TestOidcAssumedRoleSession',
],
],
],
'responses' => [
200 => [
'schema' => [
'description' => 'The response parameters.'."\n",
'type' => 'object',
'properties' => [
'RequestId' => [
'description' => 'The ID of the request.'."\n",
'type' => 'string',
'example' => '3D57EAD2-8723-1F26-B69C-F8707D8B565D',
],
'OIDCTokenInfo' => [
'description' => 'The information about the OIDC token.'."\n",
'type' => 'object',
'properties' => [
'Subject' => [
'description' => 'The subject,'."\n"
."\n"
.'which is represented by the `sub` field in the OIDC Token.'."\n",
'type' => 'string',
'example' => 'KryrkIdjylZb7agUgCEf****',
],
'Issuer' => [
'description' => 'The URL of the issuer,'."\n"
."\n"
.'which is represented by the `iss` field in the OIDC Token.'."\n",
'type' => 'string',
'example' => 'https://dev-xxxxxx.okta.com',
],
'ClientIds' => [
'description' => 'The audience. If multiple audiences are returned, the audiences are separated by commas (,).'."\n"
."\n"
.'The audience is represented by the `aud` field in the OIDC Token.'."\n",
'type' => 'string',
'example' => '496271242565057****',
],
'ExpirationTime' => [
'description' => 'The time when the OIDC token expires.'."\n",
'type' => 'string',
'example' => '2021-10-20T04:27:09Z',
],
'IssuanceTime' => [
'description' => 'The time when the OIDC token was issued.'."\n",
'type' => 'string',
'example' => '2021-10-20T03:27:09Z',
],
'VerificationInfo' => [
'description' => 'The verification information about the OIDC token. For more information, see [Manage an OIDC IdP](~~327123~~).',
'type' => 'string',
'example' => 'Success',
],
],
],
'AssumedRoleUser' => [
'description' => 'The temporary identity that you use to assume the RAM role.'."\n",
'type' => 'object',
'properties' => [
'AssumedRoleId' => [
'description' => 'The ID of the temporary identity that you use to assume the RAM role.'."\n",
'type' => 'string',
'example' => '33157794895460****',
],
'Arn' => [
'description' => 'The ARN of the temporary identity that you use to assume the RAM role.'."\n",
'type' => 'string',
'example' => 'acs:ram::113511544585****:role/testoidc/TestOidcAssumedRoleSession',
],
],
],
'Credentials' => [
'description' => 'The access credentials.'."\n",
'type' => 'object',
'properties' => [
'SecurityToken' => [
'description' => 'The STS token.'."\n"
."\n"
.'> Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens.'."\n",
'type' => 'string',
'example' => 'CAIShwJ1q6Ft5B2yfSjIr5bSEsj4g7BihPWGWHz****',
],
'Expiration' => [
'description' => 'The time when the STS token expires. The time is displayed in UTC.'."\n",
'type' => 'string',
'example' => '2021-10-20T04:27:09Z',
],
'AccessKeySecret' => [
'description' => 'The AccessKey secret.'."\n",
'type' => 'string',
'example' => 'CVwjCkNzTMupZ8NbTCxCBRq3K16jtcWFTJAyBEv2****',
],
'AccessKeyId' => [
'description' => 'The AccessKey ID.'."\n",
'type' => 'string',
'example' => 'STS.NUgYrLnoC37mZZCNnAbez****',
],
],
],
'SourceIdentity' => [
'type' => 'string',
],
],
],
],
],
'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"3D57EAD2-8723-1F26-B69C-F8707D8B565D\\",\\n \\"OIDCTokenInfo\\": {\\n \\"Subject\\": \\"KryrkIdjylZb7agUgCEf****\\",\\n \\"Issuer\\": \\"https://dev-xxxxxx.okta.com\\",\\n \\"ClientIds\\": \\"496271242565057****\\",\\n \\"ExpirationTime\\": \\"2021-10-20T04:27:09Z\\",\\n \\"IssuanceTime\\": \\"2021-10-20T03:27:09Z\\",\\n \\"VerificationInfo\\": \\"Success\\"\\n },\\n \\"AssumedRoleUser\\": {\\n \\"AssumedRoleId\\": \\"33157794895460****\\",\\n \\"Arn\\": \\"acs:ram::113511544585****:role/testoidc/TestOidcAssumedRoleSession\\"\\n },\\n \\"Credentials\\": {\\n \\"SecurityToken\\": \\"CAIShwJ1q6Ft5B2yfSjIr5bSEsj4g7BihPWGWHz****\\",\\n \\"Expiration\\": \\"2021-10-20T04:27:09Z\\",\\n \\"AccessKeySecret\\": \\"CVwjCkNzTMupZ8NbTCxCBRq3K16jtcWFTJAyBEv2****\\",\\n \\"AccessKeyId\\": \\"STS.NUgYrLnoC37mZZCNnAbez****\\"\\n },\\n \\"SourceIdentity\\": \\"Alice\\"\\n}","errorExample":""},{"type":"xml","example":"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\" ?>\\n<AssumeRoleWithOIDCResponse>\\n\\t<RequestId>3D57EAD2-8723-1F26-B69C-F8707D8B565D</RequestId>\\n\\t<OIDCTokenInfo>\\n\\t\\t<Subject>KryrkIdjylZb7agUgCEf****</Subject>\\n\\t\\t<Issuer>https://dev-xxxxxx.okta.com</Issuer>\\n\\t\\t<ClientIds>496271242565057****</ClientIds>\\n\\t</OIDCTokenInfo>\\n\\t<AssumedRoleUser>\\n\\t\\t<AssumedRoleId>33157794895460****</AssumedRoleId>\\n\\t\\t<Arn>acs:ram::113511544585****:role/testoidc/TestOidcAssumedRoleSession</Arn>\\n\\t</AssumedRoleUser>\\n\\t<Credentials>\\n\\t\\t<SecurityToken>CAIShwJ1q6Ft5B2yfSjIr5bSEsj4g7BihPWGWHz****</SecurityToken>\\n\\t\\t<Expiration>2021-10-20T04:27:09Z</Expiration>\\n\\t\\t<AccessKeySecret>CVwjCkNzTMupZ8NbTCxCBRq3K16jtcWFTJAyBEv2****</AccessKeySecret>\\n\\t\\t<AccessKeyId>STS.NUgYrLnoC37mZZCNnAbez****</AccessKeyId>\\n\\t</Credentials>\\n</AssumeRoleWithOIDCResponse>\\t\\n","errorExample":""}]',
'title' => 'AssumeRoleWithOIDC',
'description' => '### Prerequisites'."\n"
."\n"
.'* An OIDC token is obtained from an external identity provider (IdP).'."\n"
.'* An OIDC IdP is created in the RAM console. For more information, see [Create an OIDC IdP](~~327123~~) or [CreateOIDCProvider](~~327135~~).'."\n"
.'* A RAM role whose trusted entity is an OIDC IdP is created in the RAM console. For more information, see [Create a RAM role for a trusted IdP](~~116805~~) or [CreateRole](~~28710~~).'."\n",
'requestParamsDescription' => '> Anonymous users can call the AssumeRoleWithOIDC operation because authentication for this operation is performed based on OIDC tokens. Therefore, you do not need to specify the following common request parameters: `Signature`, `SignatureMethod`, `SignatureVersion`, and `AccessKeyId`. For more information about common request parameters, see [Common request parameters](~~315526~~).'."\n",
],
'GetCallerIdentity' => [
'summary' => 'The ID of the Alibaba Cloud account to which the current requester belongs.',
'methods' => [
'post',
'get',
],
'schemes' => [
'https',
],
'security' => [
[
'AK' => [],
],
],
'operationType' => 'read',
'systemTags' => [
'operationType' => 'get',
'riskType' => 'none',
'chargeType' => 'free',
],
'parameters' => [],
'responses' => [
200 => [
'schema' => [
'description' => 'Queries the identity of the current requester.',
'type' => 'object',
'properties' => [
'IdentityType' => [
'description' => '',
'type' => 'string',
'example' => 'RAMUser',
],
'AccountId' => [
'description' => '',
'type' => 'string',
'example' => '196813200012****',
],
'RequestId' => [
'description' => '',
'type' => 'string',
'example' => '3C87BF47-3724-5443-ADC1-5AEAD9A03EB1',
],
'PrincipalId' => [
'description' => '',
'type' => 'string',
'example' => '28877424437521****',
],
'UserId' => [
'description' => '',
'type' => 'string',
'example' => '216959339000****',
],
'Arn' => [
'description' => '',
'type' => 'string',
'example' => 'acs:ram::196813200012****:user/admin',
],
'RoleId' => [
'description' => '',
'type' => 'string',
'example' => '33537620082992****',
],
],
],
],
],
'errorCodes' => [
500 => [
[
'errorCode' => 'InternalError',
'errorMessage' => 'STS Server Internal Error happened, please send the RequestId to us.',
],
],
],
'responseDemo' => '[{"type":"json","example":"{\\n \\"IdentityType\\": \\"RAMUser\\",\\n \\"AccountId\\": \\"196813200012****\\",\\n \\"RequestId\\": \\"3C87BF47-3724-5443-ADC1-5AEAD9A03EB1\\",\\n \\"PrincipalId\\": \\"28877424437521****\\",\\n \\"UserId\\": \\"216959339000****\\",\\n \\"Arn\\": \\"acs:ram::196813200012****:user/admin\\",\\n \\"RoleId\\": \\"33537620082992****\\"\\n}","errorExample":""},{"type":"xml","example":"","errorExample":""}]',
'title' => 'GetCallerIdentity',
],
],
'endpoints' => [
[
'regionId' => 'cn-qingdao',
'endpoint' => 'sts.cn-qingdao.aliyuncs.com',
],
[
'regionId' => 'cn-beijing',
'endpoint' => 'sts.cn-beijing.aliyuncs.com',
],
[
'regionId' => 'cn-zhangjiakou',
'endpoint' => 'sts.cn-zhangjiakou.aliyuncs.com',
],
[
'regionId' => 'cn-huhehaote',
'endpoint' => 'sts.cn-huhehaote.aliyuncs.com',
],
[
'regionId' => 'cn-wulanchabu',
'endpoint' => 'sts.cn-wulanchabu.aliyuncs.com',
],
[
'regionId' => 'cn-hangzhou',
'endpoint' => 'sts.cn-hangzhou.aliyuncs.com',
],
[
'regionId' => 'cn-shanghai',
'endpoint' => 'sts.cn-shanghai.aliyuncs.com',
],
[
'regionId' => 'cn-nanjing',
'endpoint' => 'sts.cn-nanjing.aliyuncs.com',
],
[
'regionId' => 'cn-fuzhou',
'endpoint' => 'sts.cn-fuzhou.aliyuncs.com',
],
[
'regionId' => 'cn-shenzhen',
'endpoint' => 'sts.cn-shenzhen.aliyuncs.com',
],
[
'regionId' => 'cn-chengdu',
'endpoint' => 'sts.cn-chengdu.aliyuncs.com',
],
[
'regionId' => 'cn-hongkong',
'endpoint' => 'sts.cn-hongkong.aliyuncs.com',
],
[
'regionId' => 'ap-northeast-1',
'endpoint' => 'sts.ap-northeast-1.aliyuncs.com',
],
[
'regionId' => 'ap-northeast-2',
'endpoint' => 'sts.ap-northeast-2.aliyuncs.com',
],
[
'regionId' => 'ap-southeast-1',
'endpoint' => 'sts.ap-southeast-1.aliyuncs.com',
],
[
'regionId' => 'ap-southeast-3',
'endpoint' => 'sts.ap-southeast-3.aliyuncs.com',
],
[
'regionId' => 'ap-southeast-5',
'endpoint' => 'sts.ap-southeast-5.aliyuncs.com',
],
[
'regionId' => 'us-east-1',
'endpoint' => 'sts.us-east-1.aliyuncs.com',
],
[
'regionId' => 'us-west-1',
'endpoint' => 'sts.us-west-1.aliyuncs.com',
],
[
'regionId' => 'eu-west-1',
'endpoint' => 'sts.eu-west-1.aliyuncs.com',
],
[
'regionId' => 'eu-central-1',
'endpoint' => 'sts.eu-central-1.aliyuncs.com',
],
[
'regionId' => 'me-east-1',
'endpoint' => 'sts.me-east-1.aliyuncs.com',
],
[
'regionId' => 'cn-hangzhou-finance',
'endpoint' => 'sts.aliyuncs.com',
],
[
'regionId' => 'cn-shanghai-finance-1',
'endpoint' => 'sts.cn-shanghai-finance-1.aliyuncs.com',
],
[
'regionId' => 'cn-shenzhen-finance-1',
'endpoint' => 'sts.aliyuncs.com',
],
[
'regionId' => 'ap-southeast-7',
'endpoint' => 'sts.ap-southeast-7.aliyuncs.com',
],
[
'regionId' => 'cn-beijing-finance-1',
'endpoint' => 'sts.cn-beijing-finance-1.aliyuncs.com',
],
[
'regionId' => 'me-central-1',
'endpoint' => 'sts.me-central-1.aliyuncs.com',
],
[
'regionId' => 'cn-heyuan',
'endpoint' => 'sts.cn-heyuan.aliyuncs.com',
],
[
'regionId' => 'cn-guangzhou',
'endpoint' => 'sts.cn-guangzhou.aliyuncs.com',
],
[
'regionId' => 'cn-wuhan-lr',
'endpoint' => 'sts.cn-wuhan-lr.aliyuncs.com',
],
[
'regionId' => 'na-south-1',
'endpoint' => 'sts.na-south-1.aliyuncs.com',
],
],
];
|