-
Notifications
You must be signed in to change notification settings - Fork 6
/
platformAuthenticationV3.go
96 lines (87 loc) · 4.05 KB
/
platformAuthenticationV3.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
// 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. DO NOT EDIT.
package oAuth20Extension
import (
"net/http"
"github.com/AccelByte/accelbyte-go-sdk/iam-sdk/pkg/iamclient/o_auth2_0_extension"
"github.com/AccelByte/accelbyte-go-sdk/services-api/pkg/factory"
"github.com/AccelByte/accelbyte-go-sdk/services-api/pkg/service/iam"
"github.com/AccelByte/sample-apps/pkg/repository"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
// PlatformAuthenticationV3Cmd represents the PlatformAuthenticationV3 command
var PlatformAuthenticationV3Cmd = &cobra.Command{
Use: "platformAuthenticationV3",
Short: "Platform authentication V3",
Long: `Platform authentication V3`,
RunE: func(cmd *cobra.Command, args []string) error {
oAuth20ExtensionService := &iam.OAuth20ExtensionService{
Client: factory.NewIamClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
platformId, _ := cmd.Flags().GetString("platformId")
state, _ := cmd.Flags().GetString("state")
code, _ := cmd.Flags().GetString("code")
error_, _ := cmd.Flags().GetString("error")
openidAssocHandle, _ := cmd.Flags().GetString("openidAssocHandle")
openidClaimedId, _ := cmd.Flags().GetString("openidClaimedId")
openidIdentity, _ := cmd.Flags().GetString("openidIdentity")
openidMode, _ := cmd.Flags().GetString("openidMode")
openidNs, _ := cmd.Flags().GetString("openidNs")
openidOpEndpoint, _ := cmd.Flags().GetString("openidOpEndpoint")
openidResponseNonce, _ := cmd.Flags().GetString("openidResponseNonce")
openidReturnTo, _ := cmd.Flags().GetString("openidReturnTo")
openidSig, _ := cmd.Flags().GetString("openidSig")
openidSigned, _ := cmd.Flags().GetString("openidSigned")
httpClient := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
input := &o_auth2_0_extension.PlatformAuthenticationV3Params{
PlatformID: platformId,
Code: &code,
Error: &error_,
OpenidAssocHandle: &openidAssocHandle,
OpenidClaimedID: &openidClaimedId,
OpenidIdentity: &openidIdentity,
OpenidMode: &openidMode,
OpenidNs: &openidNs,
OpenidOpEndpoint: &openidOpEndpoint,
OpenidResponseNonce: &openidResponseNonce,
OpenidReturnTo: &openidReturnTo,
OpenidSig: &openidSig,
OpenidSigned: &openidSigned,
State: state,
HTTPClient: httpClient,
}
_, errFound := oAuth20ExtensionService.PlatformAuthenticationV3Short(input)
if errFound != nil {
logrus.Error(errFound)
return errFound
}
logrus.Infof("Response CLI success.")
return nil
},
}
func init() {
PlatformAuthenticationV3Cmd.Flags().String("platformId", "", "Platform id")
_ = PlatformAuthenticationV3Cmd.MarkFlagRequired("platformId")
PlatformAuthenticationV3Cmd.Flags().String("code", "", "Code")
PlatformAuthenticationV3Cmd.Flags().String("error", "", "Error")
PlatformAuthenticationV3Cmd.Flags().String("openidAssocHandle", "", "Openid assoc handle")
PlatformAuthenticationV3Cmd.Flags().String("openidClaimedId", "", "Openid claimed id")
PlatformAuthenticationV3Cmd.Flags().String("openidIdentity", "", "Openid identity")
PlatformAuthenticationV3Cmd.Flags().String("openidMode", "", "Openid mode")
PlatformAuthenticationV3Cmd.Flags().String("openidNs", "", "Openid ns")
PlatformAuthenticationV3Cmd.Flags().String("openidOpEndpoint", "", "Openid op endpoint")
PlatformAuthenticationV3Cmd.Flags().String("openidResponseNonce", "", "Openid response nonce")
PlatformAuthenticationV3Cmd.Flags().String("openidReturnTo", "", "Openid return to")
PlatformAuthenticationV3Cmd.Flags().String("openidSig", "", "Openid sig")
PlatformAuthenticationV3Cmd.Flags().String("openidSigned", "", "Openid signed")
PlatformAuthenticationV3Cmd.Flags().String("state", "", "State")
_ = PlatformAuthenticationV3Cmd.MarkFlagRequired("state")
}