1 // Code generated by smithy-go-codegen DO NOT EDIT.
2 3 package ssooidc
4 5 import (
6 "context"
7 "fmt"
8 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
9 "github.com/aws/smithy-go/middleware"
10 smithyhttp "github.com/aws/smithy-go/transport/http"
11 )
12 13 // Registers a public client with IAM Identity Center. This allows clients to
14 // perform authorization using the authorization code grant with Proof Key for Code
15 // Exchange (PKCE) or the device code grant.
16 func (c *Client) RegisterClient(ctx context.Context, params *RegisterClientInput, optFns ...func(*Options)) (*RegisterClientOutput, error) {
17 if params == nil {
18 params = &RegisterClientInput{}
19 }
20 21 result, metadata, err := c.invokeOperation(ctx, "RegisterClient", params, optFns, c.addOperationRegisterClientMiddlewares)
22 if err != nil {
23 return nil, err
24 }
25 26 out := result.(*RegisterClientOutput)
27 out.ResultMetadata = metadata
28 return out, nil
29 }
30 31 type RegisterClientInput struct {
32 33 // The friendly name of the client.
34 //
35 // This member is required.
36 ClientName *string
37 38 // The type of client. The service supports only public as a client type. Anything
39 // other than public will be rejected by the service.
40 //
41 // This member is required.
42 ClientType *string
43 44 // This IAM Identity Center application ARN is used to define
45 // administrator-managed configuration for public client access to resources. At
46 // authorization, the scopes, grants, and redirect URI available to this client
47 // will be restricted by this application resource.
48 EntitledApplicationArn *string
49 50 // The list of OAuth 2.0 grant types that are defined by the client. This list is
51 // used to restrict the token granting flows available to the client. Supports the
52 // following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh
53 // Token.
54 //
55 // * Authorization Code - authorization_code
56 //
57 // * Device Code - urn:ietf:params:oauth:grant-type:device_code
58 //
59 // * Refresh Token - refresh_token
60 GrantTypes []string
61 62 // The IAM Identity Center Issuer URL associated with an instance of IAM Identity
63 // Center. This value is needed for user access to resources through the client.
64 IssuerUrl *string
65 66 // The list of redirect URI that are defined by the client. At completion of
67 // authorization, this list is used to restrict what locations the user agent can
68 // be redirected back to.
69 RedirectUris []string
70 71 // The list of scopes that are defined by the client. Upon authorization, this
72 // list is used to restrict permissions when granting an access token.
73 Scopes []string
74 75 noSmithyDocumentSerde
76 }
77 78 type RegisterClientOutput struct {
79 80 // An endpoint that the client can use to request authorization.
81 AuthorizationEndpoint *string
82 83 // The unique identifier string for each client. This client uses this identifier
84 // to get authenticated by the service in subsequent calls.
85 ClientId *string
86 87 // Indicates the time at which the clientId and clientSecret were issued.
88 ClientIdIssuedAt int64
89 90 // A secret string generated for the client. The client will use this string to
91 // get authenticated by the service in subsequent calls.
92 ClientSecret *string
93 94 // Indicates the time at which the clientId and clientSecret will become invalid.
95 ClientSecretExpiresAt int64
96 97 // An endpoint that the client can use to create tokens.
98 TokenEndpoint *string
99 100 // Metadata pertaining to the operation's result.
101 ResultMetadata middleware.Metadata
102 103 noSmithyDocumentSerde
104 }
105 106 func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, options Options) (err error) {
107 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
108 return err
109 }
110 err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterClient{}, middleware.After)
111 if err != nil {
112 return err
113 }
114 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterClient{}, middleware.After)
115 if err != nil {
116 return err
117 }
118 if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterClient"); err != nil {
119 return fmt.Errorf("add protocol finalizers: %v", err)
120 }
121 122 if err = addlegacyEndpointContextSetter(stack, options); err != nil {
123 return err
124 }
125 if err = addSetLoggerMiddleware(stack, options); err != nil {
126 return err
127 }
128 if err = addClientRequestID(stack); err != nil {
129 return err
130 }
131 if err = addComputeContentLength(stack); err != nil {
132 return err
133 }
134 if err = addResolveEndpointMiddleware(stack, options); err != nil {
135 return err
136 }
137 if err = addRetry(stack, options); err != nil {
138 return err
139 }
140 if err = addRawResponseToMetadata(stack); err != nil {
141 return err
142 }
143 if err = addRecordResponseTiming(stack); err != nil {
144 return err
145 }
146 if err = addSpanRetryLoop(stack, options); err != nil {
147 return err
148 }
149 if err = addClientUserAgent(stack, options); err != nil {
150 return err
151 }
152 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
153 return err
154 }
155 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
156 return err
157 }
158 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
159 return err
160 }
161 if err = addTimeOffsetBuild(stack, c); err != nil {
162 return err
163 }
164 if err = addUserAgentRetryMode(stack, options); err != nil {
165 return err
166 }
167 if err = addCredentialSource(stack, options); err != nil {
168 return err
169 }
170 if err = addOpRegisterClientValidationMiddleware(stack); err != nil {
171 return err
172 }
173 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterClient(options.Region), middleware.Before); err != nil {
174 return err
175 }
176 if err = addRecursionDetection(stack); err != nil {
177 return err
178 }
179 if err = addRequestIDRetrieverMiddleware(stack); err != nil {
180 return err
181 }
182 if err = addResponseErrorMiddleware(stack); err != nil {
183 return err
184 }
185 if err = addRequestResponseLogging(stack, options); err != nil {
186 return err
187 }
188 if err = addDisableHTTPSMiddleware(stack, options); err != nil {
189 return err
190 }
191 if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
192 return err
193 }
194 if err = addInterceptAttempt(stack, options); err != nil {
195 return err
196 }
197 if err = addInterceptors(stack, options); err != nil {
198 return err
199 }
200 return nil
201 }
202 203 func newServiceMetadataMiddleware_opRegisterClient(region string) *awsmiddleware.RegisterServiceMetadata {
204 return &awsmiddleware.RegisterServiceMetadata{
205 Region: region,
206 ServiceID: ServiceID,
207 OperationName: "RegisterClient",
208 }
209 }
210