api_op_RegisterClient.go (4485B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package ssooidc 4 5 import ( 6 "context" 7 8 "github.com/aws/smithy-go/middleware" 9 ) 10 11 // Registers a public client with IAM Identity Center. This allows clients to 12 // perform authorization using the authorization code grant with Proof Key for Code 13 // Exchange (PKCE) or the device code grant. 14 func (c *Client) RegisterClient(ctx context.Context, params *RegisterClientInput, optFns ...func(*Options)) (*RegisterClientOutput, error) { 15 if params == nil { 16 params = &RegisterClientInput{} 17 } 18 19 result, metadata, err := c.invokeOperation(ctx, "RegisterClient", params, optFns, c.addOperationRegisterClientMiddlewares) 20 if err != nil { 21 return nil, err 22 } 23 24 out := result.(*RegisterClientOutput) 25 out.ResultMetadata = metadata 26 return out, nil 27 } 28 29 type RegisterClientInput struct { 30 31 // The friendly name of the client. 32 // 33 // This member is required. 34 ClientName *string 35 36 // The type of client. The service supports only public as a client type. Anything 37 // other than public will be rejected by the service. 38 // 39 // This member is required. 40 ClientType *string 41 42 // This IAM Identity Center application ARN is used to define 43 // administrator-managed configuration for public client access to resources. At 44 // authorization, the scopes, grants, and redirect URI available to this client 45 // will be restricted by this application resource. 46 EntitledApplicationArn *string 47 48 // The list of OAuth 2.0 grant types that are defined by the client. This list is 49 // used to restrict the token granting flows available to the client. Supports the 50 // following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh 51 // Token. 52 // 53 // * Authorization Code - authorization_code 54 // 55 // * Device Code - urn:ietf:params:oauth:grant-type:device_code 56 // 57 // * Refresh Token - refresh_token 58 GrantTypes []string 59 60 // The IAM Identity Center Issuer URL associated with an instance of IAM Identity 61 // Center. This value is needed for user access to resources through the client. 62 IssuerUrl *string 63 64 // The list of redirect URI that are defined by the client. At completion of 65 // authorization, this list is used to restrict what locations the user agent can 66 // be redirected back to. 67 RedirectUris []string 68 69 // The list of scopes that are defined by the client. Upon authorization, this 70 // list is used to restrict permissions when granting an access token. 71 Scopes []string 72 73 noSmithyDocumentSerde 74 } 75 76 type RegisterClientOutput struct { 77 78 // An endpoint that the client can use to request authorization. 79 AuthorizationEndpoint *string 80 81 // The unique identifier string for each client. This client uses this identifier 82 // to get authenticated by the service in subsequent calls. 83 ClientId *string 84 85 // Indicates the time at which the clientId and clientSecret were issued. 86 ClientIdIssuedAt int64 87 88 // A secret string generated for the client. The client will use this string to 89 // get authenticated by the service in subsequent calls. 90 ClientSecret *string 91 92 // Indicates the time at which the clientId and clientSecret will become invalid. 93 ClientSecretExpiresAt int64 94 95 // An endpoint that the client can use to create tokens. 96 TokenEndpoint *string 97 98 // Metadata pertaining to the operation's result. 99 ResultMetadata middleware.Metadata 100 101 noSmithyDocumentSerde 102 } 103 104 func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, options Options) (err error) { 105 err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterClient{}, middleware.After) 106 if err != nil { 107 return err 108 } 109 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterClient{}, middleware.After) 110 if err != nil { 111 return err 112 } 113 114 if err = addComputeContentLength(stack); err != nil { 115 return err 116 } 117 if err = addResolveEndpointMiddleware(stack, options); err != nil { 118 return err 119 } 120 if err = addRecordResponseTiming(stack, options); err != nil { 121 return err 122 } 123 if err = addCredentialSource(stack, options); err != nil { 124 return err 125 } 126 if err = addOpRegisterClientValidationMiddleware(stack); err != nil { 127 return err 128 } 129 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 130 return err 131 } 132 if err = addResponseErrorMiddleware(stack); err != nil { 133 return err 134 } 135 if err = addRequestResponseLogging(stack, options); err != nil { 136 return err 137 } 138 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 139 return err 140 } 141 if err = addInterceptors(stack, options); err != nil { 142 return err 143 } 144 return nil 145 }