-
Notifications
You must be signed in to change notification settings - Fork 6
/
o_auth20_client.go
2191 lines (1886 loc) · 91.9 KB
/
o_auth20_client.go
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
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.
// Code generated by go-swagger; DO NOT EDIT.
package o_auth2_0
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"fmt"
"reflect"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new o auth2 0 API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for o auth2 0 API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientService is the interface for Client methods
type ClientService interface {
AdminRetrieveUserThirdPartyPlatformTokenV3(params *AdminRetrieveUserThirdPartyPlatformTokenV3Params, authInfo runtime.ClientAuthInfoWriter) (*AdminRetrieveUserThirdPartyPlatformTokenV3OK, *AdminRetrieveUserThirdPartyPlatformTokenV3Unauthorized, *AdminRetrieveUserThirdPartyPlatformTokenV3Forbidden, *AdminRetrieveUserThirdPartyPlatformTokenV3NotFound, error)
AdminRetrieveUserThirdPartyPlatformTokenV3Short(params *AdminRetrieveUserThirdPartyPlatformTokenV3Params, authInfo runtime.ClientAuthInfoWriter) (*AdminRetrieveUserThirdPartyPlatformTokenV3OK, error)
AuthCodeRequestV3(params *AuthCodeRequestV3Params, authInfo runtime.ClientAuthInfoWriter) (*AuthCodeRequestV3Found, error)
AuthCodeRequestV3Short(params *AuthCodeRequestV3Params, authInfo runtime.ClientAuthInfoWriter) (*AuthCodeRequestV3Found, error)
AuthorizeV3(params *AuthorizeV3Params, authInfo runtime.ClientAuthInfoWriter) (*AuthorizeV3Found, error)
AuthorizeV3Short(params *AuthorizeV3Params, authInfo runtime.ClientAuthInfoWriter) (*AuthorizeV3Found, error)
Change2FAMethod(params *Change2FAMethodParams, authInfo runtime.ClientAuthInfoWriter) (*Change2FAMethodNoContent, *Change2FAMethodBadRequest, *Change2FAMethodInternalServerError, error)
Change2FAMethodShort(params *Change2FAMethodParams, authInfo runtime.ClientAuthInfoWriter) (*Change2FAMethodNoContent, error)
GetJWKSV3(params *GetJWKSV3Params, authInfo runtime.ClientAuthInfoWriter) (*GetJWKSV3OK, error)
GetJWKSV3Short(params *GetJWKSV3Params, authInfo runtime.ClientAuthInfoWriter) (*GetJWKSV3OK, error)
GetRevocationListV3(params *GetRevocationListV3Params, authInfo runtime.ClientAuthInfoWriter) (*GetRevocationListV3OK, *GetRevocationListV3Unauthorized, error)
GetRevocationListV3Short(params *GetRevocationListV3Params, authInfo runtime.ClientAuthInfoWriter) (*GetRevocationListV3OK, error)
PlatformTokenGrantV3(params *PlatformTokenGrantV3Params, authInfo runtime.ClientAuthInfoWriter) (*PlatformTokenGrantV3OK, *PlatformTokenGrantV3BadRequest, *PlatformTokenGrantV3Unauthorized, *PlatformTokenGrantV3Forbidden, error)
PlatformTokenGrantV3Short(params *PlatformTokenGrantV3Params, authInfo runtime.ClientAuthInfoWriter) (*PlatformTokenGrantV3OK, error)
RetrieveUserThirdPartyPlatformTokenV3(params *RetrieveUserThirdPartyPlatformTokenV3Params, authInfo runtime.ClientAuthInfoWriter) (*RetrieveUserThirdPartyPlatformTokenV3OK, *RetrieveUserThirdPartyPlatformTokenV3Unauthorized, *RetrieveUserThirdPartyPlatformTokenV3Forbidden, *RetrieveUserThirdPartyPlatformTokenV3NotFound, error)
RetrieveUserThirdPartyPlatformTokenV3Short(params *RetrieveUserThirdPartyPlatformTokenV3Params, authInfo runtime.ClientAuthInfoWriter) (*RetrieveUserThirdPartyPlatformTokenV3OK, error)
RevokeUserV3(params *RevokeUserV3Params, authInfo runtime.ClientAuthInfoWriter) (*RevokeUserV3OK, *RevokeUserV3BadRequest, *RevokeUserV3Unauthorized, *RevokeUserV3Forbidden, error)
RevokeUserV3Short(params *RevokeUserV3Params, authInfo runtime.ClientAuthInfoWriter) (*RevokeUserV3OK, error)
SendMFAAuthenticationCode(params *SendMFAAuthenticationCodeParams, authInfo runtime.ClientAuthInfoWriter) (*SendMFAAuthenticationCodeNoContent, *SendMFAAuthenticationCodeBadRequest, *SendMFAAuthenticationCodeForbidden, *SendMFAAuthenticationCodeNotFound, *SendMFAAuthenticationCodeTooManyRequests, *SendMFAAuthenticationCodeInternalServerError, error)
SendMFAAuthenticationCodeShort(params *SendMFAAuthenticationCodeParams, authInfo runtime.ClientAuthInfoWriter) (*SendMFAAuthenticationCodeNoContent, error)
TokenGrantV3(params *TokenGrantV3Params, authInfo runtime.ClientAuthInfoWriter) (*TokenGrantV3OK, *TokenGrantV3BadRequest, *TokenGrantV3Unauthorized, *TokenGrantV3Forbidden, *TokenGrantV3TooManyRequests, error)
TokenGrantV3Short(params *TokenGrantV3Params, authInfo runtime.ClientAuthInfoWriter) (*TokenGrantV3OK, error)
TokenIntrospectionV3(params *TokenIntrospectionV3Params, authInfo runtime.ClientAuthInfoWriter) (*TokenIntrospectionV3OK, *TokenIntrospectionV3BadRequest, *TokenIntrospectionV3Unauthorized, error)
TokenIntrospectionV3Short(params *TokenIntrospectionV3Params, authInfo runtime.ClientAuthInfoWriter) (*TokenIntrospectionV3OK, error)
TokenRevocationV3(params *TokenRevocationV3Params, authInfo runtime.ClientAuthInfoWriter) (*TokenRevocationV3OK, *TokenRevocationV3BadRequest, *TokenRevocationV3Unauthorized, error)
TokenRevocationV3Short(params *TokenRevocationV3Params, authInfo runtime.ClientAuthInfoWriter) (*TokenRevocationV3OK, error)
Verify2FACode(params *Verify2FACodeParams, authInfo runtime.ClientAuthInfoWriter) (*Verify2FACodeOK, *Verify2FACodeUnauthorized, error)
Verify2FACodeShort(params *Verify2FACodeParams, authInfo runtime.ClientAuthInfoWriter) (*Verify2FACodeOK, error)
VerifyTokenV3(params *VerifyTokenV3Params, authInfo runtime.ClientAuthInfoWriter) (*VerifyTokenV3OK, *VerifyTokenV3BadRequest, error)
VerifyTokenV3Short(params *VerifyTokenV3Params, authInfo runtime.ClientAuthInfoWriter) (*VerifyTokenV3OK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
Deprecated: Use AdminRetrieveUserThirdPartyPlatformTokenV3Short instead.
AdminRetrieveUserThirdPartyPlatformTokenV3 admins retrieve user third party platform token
Admin Retrieve User Third Party Platform Token<br/>
<p>
This endpoint used for retrieving third party platform token for user that login using third party,
if user have not link requested platform in game namespace, will try to retrieving third party platform token from publisher namespace.
Passing platform group name or it's member will return same access token that can be used across the platform members.
</p>
<p>Notes:</p>
<ul>
<li>Required permission: ADMIN:NAMESPACE:{namespace}:USER:{userId} [READ]</li>
</ul>
<p>The third party platform and platform group covered for this is:</p>
<ul>
<li>(psn) ps4web</li>
<li>(psn) ps4</li>
<li>(psn) ps5</li>
<li>xbox live</li>
<li>steam</li>
</ul>
*/
func (a *Client) AdminRetrieveUserThirdPartyPlatformTokenV3(params *AdminRetrieveUserThirdPartyPlatformTokenV3Params, authInfo runtime.ClientAuthInfoWriter) (*AdminRetrieveUserThirdPartyPlatformTokenV3OK, *AdminRetrieveUserThirdPartyPlatformTokenV3Unauthorized, *AdminRetrieveUserThirdPartyPlatformTokenV3Forbidden, *AdminRetrieveUserThirdPartyPlatformTokenV3NotFound, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAdminRetrieveUserThirdPartyPlatformTokenV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "AdminRetrieveUserThirdPartyPlatformTokenV3",
Method: "GET",
PathPattern: "/iam/v3/oauth/admin/namespaces/{namespace}/users/{userId}/platforms/{platformId}/platformToken",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"},
Schemes: []string{"https"},
Params: params,
Reader: &AdminRetrieveUserThirdPartyPlatformTokenV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, nil, nil, nil, err
}
switch v := result.(type) {
case *AdminRetrieveUserThirdPartyPlatformTokenV3OK:
return v, nil, nil, nil, nil
case *AdminRetrieveUserThirdPartyPlatformTokenV3Unauthorized:
return nil, v, nil, nil, nil
case *AdminRetrieveUserThirdPartyPlatformTokenV3Forbidden:
return nil, nil, v, nil, nil
case *AdminRetrieveUserThirdPartyPlatformTokenV3NotFound:
return nil, nil, nil, v, nil
default:
return nil, nil, nil, nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
AdminRetrieveUserThirdPartyPlatformTokenV3Short admins retrieve user third party platform token
Admin Retrieve User Third Party Platform Token<br/>
<p>
This endpoint used for retrieving third party platform token for user that login using third party,
if user have not link requested platform in game namespace, will try to retrieving third party platform token from publisher namespace.
Passing platform group name or it's member will return same access token that can be used across the platform members.
</p>
<p>Notes:</p>
<ul>
<li>Required permission: ADMIN:NAMESPACE:{namespace}:USER:{userId} [READ]</li>
</ul>
<p>The third party platform and platform group covered for this is:</p>
<ul>
<li>(psn) ps4web</li>
<li>(psn) ps4</li>
<li>(psn) ps5</li>
<li>xbox live</li>
<li>steam</li>
</ul>
*/
func (a *Client) AdminRetrieveUserThirdPartyPlatformTokenV3Short(params *AdminRetrieveUserThirdPartyPlatformTokenV3Params, authInfo runtime.ClientAuthInfoWriter) (*AdminRetrieveUserThirdPartyPlatformTokenV3OK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAdminRetrieveUserThirdPartyPlatformTokenV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "AdminRetrieveUserThirdPartyPlatformTokenV3",
Method: "GET",
PathPattern: "/iam/v3/oauth/admin/namespaces/{namespace}/users/{userId}/platforms/{platformId}/platformToken",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"},
Schemes: []string{"https"},
Params: params,
Reader: &AdminRetrieveUserThirdPartyPlatformTokenV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
switch v := result.(type) {
case *AdminRetrieveUserThirdPartyPlatformTokenV3OK:
return v, nil
case *AdminRetrieveUserThirdPartyPlatformTokenV3Unauthorized:
return nil, v
case *AdminRetrieveUserThirdPartyPlatformTokenV3Forbidden:
return nil, v
case *AdminRetrieveUserThirdPartyPlatformTokenV3NotFound:
return nil, v
default:
return nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
Deprecated: Use AuthCodeRequestV3Short instead.
AuthCodeRequestV3 generates url to request auth code from third party platform
Generate url to request auth code from third party platform <br>
<h2>Supported platforms:</h2><ul>
<li><strong>steamopenid</strong></li>This endpoint redirects to steam login page, then redirect back to platform
authenticate endpoint after successfully authenticating user steam.
<li><strong>xblweb</strong></li>This endpoint redirects to xbox login page, then redirect back to platform
authenticate endpoint after successfully authenticating xbox user.
<li><strong>ps4web</strong></li>This endpoint redirects to psn login page, then redirect back to platform
authenticate endpoint after successfully authenticating psn user.
<li><strong>epicgames</strong></li>This endpoint redirects to Epicgames OAuth login page. then redirect to platform
authenticate endpoint after successfully authenticating an Epicgames credential
<li><strong>twitch</strong></li>This endpoint redirects to twitch login page, then redirect back to platform
authenticate endpoint after successfully authenticating twitch user.
<li><strong>azure</strong></li>This endpoint redirects to azure login page, then redirect back to platform
authenticate(saml) endpoint after successfully authenticating azure user.
<li><strong>facebook</strong></li>This endpoint redirects to facebook login page, then redirect back to platform
authenticate endpoint after successfully authenticating facebook user.
<li><strong>google</strong></li>This endpoint redirects to google login page, then redirect back to platform
authenticate endpoint after successfully authenticating google user.
<li><strong>snapchat</strong></li>This endpoint redirects to snapchat login page, then redirect back to platform
authenticate endpoint after successfully authenticating snapchat user.
<li><strong>discord</strong></li>This endpoint redirects to discord login page, then redirect back to platform
authenticate endpoint after successfully authenticating discord user.
<li><strong>amazon</strong></li>This endpoint redirects to amazon login page, then redirect back to platform
authenticate endpoint after successfully authenticating amazon user.
</ul> action code : 10702'
*/
func (a *Client) AuthCodeRequestV3(params *AuthCodeRequestV3Params, authInfo runtime.ClientAuthInfoWriter) (*AuthCodeRequestV3Found, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAuthCodeRequestV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "AuthCodeRequestV3",
Method: "GET",
PathPattern: "/iam/v3/oauth/platforms/{platformId}/authorize",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"},
Schemes: []string{"https"},
Params: params,
Reader: &AuthCodeRequestV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
switch v := result.(type) {
case *AuthCodeRequestV3Found:
return v, nil
default:
return nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
AuthCodeRequestV3Short generates url to request auth code from third party platform
Generate url to request auth code from third party platform <br>
<h2>Supported platforms:</h2><ul>
<li><strong>steamopenid</strong></li>This endpoint redirects to steam login page, then redirect back to platform
authenticate endpoint after successfully authenticating user steam.
<li><strong>xblweb</strong></li>This endpoint redirects to xbox login page, then redirect back to platform
authenticate endpoint after successfully authenticating xbox user.
<li><strong>ps4web</strong></li>This endpoint redirects to psn login page, then redirect back to platform
authenticate endpoint after successfully authenticating psn user.
<li><strong>epicgames</strong></li>This endpoint redirects to Epicgames OAuth login page. then redirect to platform
authenticate endpoint after successfully authenticating an Epicgames credential
<li><strong>twitch</strong></li>This endpoint redirects to twitch login page, then redirect back to platform
authenticate endpoint after successfully authenticating twitch user.
<li><strong>azure</strong></li>This endpoint redirects to azure login page, then redirect back to platform
authenticate(saml) endpoint after successfully authenticating azure user.
<li><strong>facebook</strong></li>This endpoint redirects to facebook login page, then redirect back to platform
authenticate endpoint after successfully authenticating facebook user.
<li><strong>google</strong></li>This endpoint redirects to google login page, then redirect back to platform
authenticate endpoint after successfully authenticating google user.
<li><strong>snapchat</strong></li>This endpoint redirects to snapchat login page, then redirect back to platform
authenticate endpoint after successfully authenticating snapchat user.
<li><strong>discord</strong></li>This endpoint redirects to discord login page, then redirect back to platform
authenticate endpoint after successfully authenticating discord user.
<li><strong>amazon</strong></li>This endpoint redirects to amazon login page, then redirect back to platform
authenticate endpoint after successfully authenticating amazon user.
</ul> action code : 10702'
*/
func (a *Client) AuthCodeRequestV3Short(params *AuthCodeRequestV3Params, authInfo runtime.ClientAuthInfoWriter) (*AuthCodeRequestV3Found, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAuthCodeRequestV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "AuthCodeRequestV3",
Method: "GET",
PathPattern: "/iam/v3/oauth/platforms/{platformId}/authorize",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"},
Schemes: []string{"https"},
Params: params,
Reader: &AuthCodeRequestV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
switch v := result.(type) {
case *AuthCodeRequestV3Found:
return v, nil
default:
return nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
Deprecated: Use AuthorizeV3Short instead.
AuthorizeV3 os auth2 authorize API
Initializes OAuth2.0 authorization code flow<br/>
<p>The endpoint stores authorization request and redirects to login page with the authorization request id.
The user can then do the authentication on the login page.
The user will be redirected back to the requesting client with authorization code if successfully authenticated.
</p>
<p>Only authorization code flow supported by this endpoint, implicit flow is not supported.</p>
<ul>
<li><p><strong>Authorize success</strong>:
redirects to login page with the following information: ?request_id={authorization_request_id}</p>
</li>
<li><p><strong>Authorize failure</strong>:
redirects to the given redirect uri with the following information:
?error={error_code}&error_description={error description}</p>
</li>
</ul>
<p>Following are the error code based on the specification:</p>
<ul>
<li><p>invalid_request: The request is missing a required parameter,
includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.</p>
</li>
<li><p>server_error:
The authorization server encountered an unexpected condition that prevented it from fulfilling the request.</p>
</li>
<li><p>unauthorized_client: The client is not authorized to request a token using this method.</p></li>
<li><p>access_denied: The resource owner or authorization server denied the request.</p></li>
<li><p>invalid_scope: The requested scope is invalid, unknown, or malformed.</p></li>
<li><p>unsupported_response_type: The authorization server does not support obtaining a token using this method.</p></li>
<li><p>temporarily_unavailable: The authorization server is currently unable to handle the request
due to a temporary overloading or maintenance of the server.</p>
</li>
</ul>
<p>Please refer to the RFC for more information about authorization code flow: https://tools.ietf.org/html/rfc6749#section-4.1</p><br>
action code: 10701
*/
func (a *Client) AuthorizeV3(params *AuthorizeV3Params, authInfo runtime.ClientAuthInfoWriter) (*AuthorizeV3Found, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAuthorizeV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "AuthorizeV3",
Method: "GET",
PathPattern: "/iam/v3/oauth/authorize",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &AuthorizeV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
switch v := result.(type) {
case *AuthorizeV3Found:
return v, nil
default:
return nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
AuthorizeV3Short os auth2 authorize API
Initializes OAuth2.0 authorization code flow<br/>
<p>The endpoint stores authorization request and redirects to login page with the authorization request id.
The user can then do the authentication on the login page.
The user will be redirected back to the requesting client with authorization code if successfully authenticated.
</p>
<p>Only authorization code flow supported by this endpoint, implicit flow is not supported.</p>
<ul>
<li><p><strong>Authorize success</strong>:
redirects to login page with the following information: ?request_id={authorization_request_id}</p>
</li>
<li><p><strong>Authorize failure</strong>:
redirects to the given redirect uri with the following information:
?error={error_code}&error_description={error description}</p>
</li>
</ul>
<p>Following are the error code based on the specification:</p>
<ul>
<li><p>invalid_request: The request is missing a required parameter,
includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.</p>
</li>
<li><p>server_error:
The authorization server encountered an unexpected condition that prevented it from fulfilling the request.</p>
</li>
<li><p>unauthorized_client: The client is not authorized to request a token using this method.</p></li>
<li><p>access_denied: The resource owner or authorization server denied the request.</p></li>
<li><p>invalid_scope: The requested scope is invalid, unknown, or malformed.</p></li>
<li><p>unsupported_response_type: The authorization server does not support obtaining a token using this method.</p></li>
<li><p>temporarily_unavailable: The authorization server is currently unable to handle the request
due to a temporary overloading or maintenance of the server.</p>
</li>
</ul>
<p>Please refer to the RFC for more information about authorization code flow: https://tools.ietf.org/html/rfc6749#section-4.1</p><br>
action code: 10701
*/
func (a *Client) AuthorizeV3Short(params *AuthorizeV3Params, authInfo runtime.ClientAuthInfoWriter) (*AuthorizeV3Found, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAuthorizeV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "AuthorizeV3",
Method: "GET",
PathPattern: "/iam/v3/oauth/authorize",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &AuthorizeV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
switch v := result.(type) {
case *AuthorizeV3Found:
return v, nil
default:
return nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
Deprecated: Use Change2FAMethodShort instead.
Change2FAMethod changes 2 f a method
Change 2FA method<br/>
<p>This endpoint is used for change 2FA method. Only enabled methods are accepted.</p>
<p>Supported methods:</p>
<ul>
<li>authenticator</li>
<li>backupCode</li>
<li>email</li>
</ul>
*/
func (a *Client) Change2FAMethod(params *Change2FAMethodParams, authInfo runtime.ClientAuthInfoWriter) (*Change2FAMethodNoContent, *Change2FAMethodBadRequest, *Change2FAMethodInternalServerError, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewChange2FAMethodParams()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "Change2FAMethod",
Method: "POST",
PathPattern: "/iam/v3/oauth/mfa/factor/change",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"},
Schemes: []string{"https"},
Params: params,
Reader: &Change2FAMethodReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, nil, nil, err
}
switch v := result.(type) {
case *Change2FAMethodNoContent:
return v, nil, nil, nil
case *Change2FAMethodBadRequest:
return nil, v, nil, nil
case *Change2FAMethodInternalServerError:
return nil, nil, v, nil
default:
return nil, nil, nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
Change2FAMethodShort changes 2 f a method
Change 2FA method<br/>
<p>This endpoint is used for change 2FA method. Only enabled methods are accepted.</p>
<p>Supported methods:</p>
<ul>
<li>authenticator</li>
<li>backupCode</li>
<li>email</li>
</ul>
*/
func (a *Client) Change2FAMethodShort(params *Change2FAMethodParams, authInfo runtime.ClientAuthInfoWriter) (*Change2FAMethodNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewChange2FAMethodParams()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "Change2FAMethod",
Method: "POST",
PathPattern: "/iam/v3/oauth/mfa/factor/change",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"},
Schemes: []string{"https"},
Params: params,
Reader: &Change2FAMethodReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
switch v := result.(type) {
case *Change2FAMethodNoContent:
return v, nil
case *Change2FAMethodBadRequest:
return nil, v
case *Change2FAMethodInternalServerError:
return nil, v
default:
return nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
Deprecated: Use GetJWKSV3Short instead.
GetJWKSV3 JSONs web key set for verifying j w t
<p>This endpoint serves public keys for verifying JWT access tokens generated by this service.</p>
<p>When a client application wants to verify a JWT token, it needs to get the 'kid' value found in the JWT token header and use it
to look up the corresponding public key from a set returned by this endpoint. The client application can then use that public key to verify the JWT.</p>
<p>A client application might cache the keys so it doesn't need to do request every time it needs to verify a JWT token. If a client application
caches the keys and a key with the same 'kid' cannot be found in the cache, it should then try to refresh the keys by making a request to this
endpoint again.</p>
<p>Please refer to the RFC for more information about JWK (JSON Web Key): https://tools.ietf.org/html/rfc7517</p>
<br>action code : 10709
*/
func (a *Client) GetJWKSV3(params *GetJWKSV3Params, authInfo runtime.ClientAuthInfoWriter) (*GetJWKSV3OK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetJWKSV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetJWKSV3",
Method: "GET",
PathPattern: "/iam/v3/oauth/jwks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{""},
Schemes: []string{"https"},
Params: params,
Reader: &GetJWKSV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
switch v := result.(type) {
case *GetJWKSV3OK:
return v, nil
default:
return nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
GetJWKSV3Short JSONs web key set for verifying j w t
<p>This endpoint serves public keys for verifying JWT access tokens generated by this service.</p>
<p>When a client application wants to verify a JWT token, it needs to get the 'kid' value found in the JWT token header and use it
to look up the corresponding public key from a set returned by this endpoint. The client application can then use that public key to verify the JWT.</p>
<p>A client application might cache the keys so it doesn't need to do request every time it needs to verify a JWT token. If a client application
caches the keys and a key with the same 'kid' cannot be found in the cache, it should then try to refresh the keys by making a request to this
endpoint again.</p>
<p>Please refer to the RFC for more information about JWK (JSON Web Key): https://tools.ietf.org/html/rfc7517</p>
<br>action code : 10709
*/
func (a *Client) GetJWKSV3Short(params *GetJWKSV3Params, authInfo runtime.ClientAuthInfoWriter) (*GetJWKSV3OK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetJWKSV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetJWKSV3",
Method: "GET",
PathPattern: "/iam/v3/oauth/jwks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{""},
Schemes: []string{"https"},
Params: params,
Reader: &GetJWKSV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
switch v := result.(type) {
case *GetJWKSV3OK:
return v, nil
default:
return nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
Deprecated: Use GetRevocationListV3Short instead.
GetRevocationListV3 os auth2 revocation list API
<p>This endpoint will return a list of revoked users and revoked tokens. List of revoked tokens in bloom filter format.</p>
<p>This endpoint requires authorized requests header with valid access token.</p>
<p>The bloom filter uses MurmurHash3 algorithm for hashing the values</p>
<p>action code : 10708</p>
*/
func (a *Client) GetRevocationListV3(params *GetRevocationListV3Params, authInfo runtime.ClientAuthInfoWriter) (*GetRevocationListV3OK, *GetRevocationListV3Unauthorized, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetRevocationListV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetRevocationListV3",
Method: "GET",
PathPattern: "/iam/v3/oauth/revocationlist",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{""},
Schemes: []string{"https"},
Params: params,
Reader: &GetRevocationListV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, nil, err
}
switch v := result.(type) {
case *GetRevocationListV3OK:
return v, nil, nil
case *GetRevocationListV3Unauthorized:
return nil, v, nil
default:
return nil, nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
GetRevocationListV3Short os auth2 revocation list API
<p>This endpoint will return a list of revoked users and revoked tokens. List of revoked tokens in bloom filter format.</p>
<p>This endpoint requires authorized requests header with valid access token.</p>
<p>The bloom filter uses MurmurHash3 algorithm for hashing the values</p>
<p>action code : 10708</p>
*/
func (a *Client) GetRevocationListV3Short(params *GetRevocationListV3Params, authInfo runtime.ClientAuthInfoWriter) (*GetRevocationListV3OK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetRevocationListV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetRevocationListV3",
Method: "GET",
PathPattern: "/iam/v3/oauth/revocationlist",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{""},
Schemes: []string{"https"},
Params: params,
Reader: &GetRevocationListV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
switch v := result.(type) {
case *GetRevocationListV3OK:
return v, nil
case *GetRevocationListV3Unauthorized:
return nil, v
default:
return nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
Deprecated: Use PlatformTokenGrantV3Short instead.
PlatformTokenGrantV3 os auth2 access token generation specific to platform
<p>Platform token grant specifically used for performing token grant using platform, e.g. Steam, Justice, etc. The endpoint automatically create an account if the account associated with the platform is not exists yet.
This endpoint requires all requests to have Authorization header set with Basic access authentication
constructed from client id and client secret. For publisher-game namespace schema : Specify only either platform_token or device_id. Device token grant
should be requested along with device_id parameter against game namespace. Another 3rd party platform token grant should be requested
along with platform_token parameter against publisher namespace.</p><br/>
<h2>2FA remember device</h2>
<p>To remember device for 2FA, should provide cookie: device_token or header: Device-Token</p>
<h2>Supported platforms:</h2>
<ul>
<li><strong>steam</strong>: The platform_token’s value is the authentication code returned by Steam.</li>
<li><strong>steamopenid</strong>: Steam's user authentication method using OpenID 2.0. The platform_token's value is URL generated by Steam on web authentication</li>
<li><strong>facebook</strong>: The platform_token’s value is the authorization code returned by Facebook OAuth</li>
<li><strong>google</strong>: The platform_token’s value is the authorization code returned by Google OAuth</li>
<li><strong>oculus</strong>: The platform_token’s value is a string composed of Oculus's user ID and the nonce separated by a colon (:).</li>
<li><strong>twitch</strong>: The platform_token’s value is the authorization code returned by Twitch OAuth.</li>
<li><strong>discord</strong>: The platform_token’s value is the authorization code returned by Discord OAuth</li>
<li><strong>android</strong>: The device_id is the Android’s device ID</li>
<li><strong>ios</strong>: The device_id is the iOS’s device ID.</li>
<li><strong>apple</strong>: The platform_token’s value is the authorization code returned by Apple OAuth.(We will use this code to generate APP token)</li>
<li><strong>device</strong>: Every device that does’nt run Android and iOS is categorized as a device. The device_id is the device’s ID.</li>
<li><strong>justice</strong>: The platform_token’s value is the designated user’s access token.</li>
<li><strong>epicgames</strong>: The platform_token’s value is an access-token obtained from Epicgames EOS Account Service.</li>
<li><strong>stadia</strong>: The platform_token's value is a JWT Token, which can be obtained after calling the Stadia SDK's function.</li>
<li><strong>ps4</strong>: The platform_token’s value is the authorization code returned by Sony OAuth.</li>
<li><strong>ps5</strong>: The platform_token’s value is the authorization code returned by Sony OAuth.</li>
<li><strong>nintendo</strong>: The platform_token’s value is the authorization code(id_token) returned by Nintendo OAuth.</li>
<li><strong>awscognito</strong>: The platform_token’s value is the aws cognito access token or id token (JWT).</li>
<li><strong>live</strong>: The platform_token’s value is xbox XSTS token</li>
<li><strong>xblweb</strong>: The platform_token’s value is code returned by xbox after login</li>
<li><strong>netflix</strong>: The platform_token’s value is GAT (Gamer Access Token) returned by Netflix backend</li>
<li><strong>snapchat</strong>: The platform_token’s value is the authorization code returned by Snapchat OAuth.</li>
</ul>
<h2>Account Group</h2>
<p>Several platforms are grouped under account groups. The accounts on these platforms have the same platform user id.
Login using one of these platform will returns the same IAM user. </p>
<p>Following is the current registered account grouping: </p>
<ul>
<li> (psn) ps4web </li>
<li> (psn) ps4 </li>
<li> (psn) ps5 </li>
</ul>
<h2>Access Token Content</h2>
<p>Following is the access token’s content:</p>
<ul>
<li>
<p><strong>namespace</strong>. It is the namespace the token was generated from.</p>
</li>
<li>
<p><strong>display_name</strong>. The display name of the sub. It is empty if the token is generated from the client credential</p>
</li>
<li>
<p><strong>roles</strong>. The sub’s roles. It is empty if the token is generated from the client credential</p>
</li>
<li>
<p><strong>namespace_roles</strong>. The sub’s roles scoped to namespace. Improvement from roles, which make the role scoped to specific namespace instead of global to publisher namespace</p>
</li>
<li>
<p><strong>permissions</strong>. The sub or aud’ permissions</p>
</li>
<li>
<p><strong>bans</strong>. The sub’s list of bans. It is used by the IAM client for validating the token.</p>
</li>
<li>
<p><strong>jflgs</strong>. It stands for Justice Flags. It is a special flag used for storing additional status information regarding the sub. It is implemented as a bit mask. Following explains what each bit represents:</p>
<ul>
<li><p>1: Email Address Verified</p></li>
<li><p>2: Phone Number Verified</p></li>
<li><p>4: Anonymous</p></li>
<li><p>8: Suspicious Login</p></li>
</ul>
</li>
<li>
<p><strong>aud</strong>. The aud is the client ID.</p>
</li>
<li>
<p><strong>iat</strong>. The time the token issues at. It is in Epoch time format</p>
</li>
<li>
<p><strong>exp</strong>. The time the token expires. It is in Epoch time format</p>
</li>
<li>
<p><strong>sub</strong>. The UserID. The sub is omitted if the token is generated from client credential</p>
</li>
<h2>Bans</h2>
<p>The JWT contains user's active bans with its expiry date. List of ban types can be obtained from /bans.</p>
<br>action code : 10704
*/
func (a *Client) PlatformTokenGrantV3(params *PlatformTokenGrantV3Params, authInfo runtime.ClientAuthInfoWriter) (*PlatformTokenGrantV3OK, *PlatformTokenGrantV3BadRequest, *PlatformTokenGrantV3Unauthorized, *PlatformTokenGrantV3Forbidden, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPlatformTokenGrantV3Params()
}
if params.Context == nil {
params.Context = context.Background()
}
if params.RetryPolicy != nil {
params.SetHTTPClientTransport(params.RetryPolicy)
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "PlatformTokenGrantV3",
Method: "POST",
PathPattern: "/iam/v3/oauth/platforms/{platformId}/token",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"},
Schemes: []string{"https"},
Params: params,
Reader: &PlatformTokenGrantV3Reader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, nil, nil, nil, err
}
switch v := result.(type) {
case *PlatformTokenGrantV3OK:
return v, nil, nil, nil, nil
case *PlatformTokenGrantV3BadRequest:
return nil, v, nil, nil, nil
case *PlatformTokenGrantV3Unauthorized:
return nil, nil, v, nil, nil
case *PlatformTokenGrantV3Forbidden:
return nil, nil, nil, v, nil
default:
return nil, nil, nil, nil, fmt.Errorf("Unexpected Type %v", reflect.TypeOf(v))
}
}
/*
PlatformTokenGrantV3Short os auth2 access token generation specific to platform
<p>Platform token grant specifically used for performing token grant using platform, e.g. Steam, Justice, etc. The endpoint automatically create an account if the account associated with the platform is not exists yet.
This endpoint requires all requests to have Authorization header set with Basic access authentication
constructed from client id and client secret. For publisher-game namespace schema : Specify only either platform_token or device_id. Device token grant
should be requested along with device_id parameter against game namespace. Another 3rd party platform token grant should be requested
along with platform_token parameter against publisher namespace.</p><br/>
<h2>2FA remember device</h2>