api_op_Logout.go (3164B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package sso 4 5 import ( 6 "context" 7 8 "github.com/aws/smithy-go/middleware" 9 ) 10 11 // Removes the locally stored SSO tokens from the client-side cache and sends an 12 // API call to the IAM Identity Center service to invalidate the corresponding 13 // server-side IAM Identity Center sign in session. 14 // 15 // If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM 16 // Identity Center sign in session is used to obtain an IAM session, as specified 17 // in the corresponding IAM Identity Center permission set. More specifically, IAM 18 // Identity Center assumes an IAM role in the target account on behalf of the user, 19 // and the corresponding temporary AWS credentials are returned to the client. 20 // 21 // After user logout, any existing IAM role sessions that were created by using 22 // IAM Identity Center permission sets continue based on the duration configured in 23 // the permission set. For more information, see [User authentications]in the IAM Identity Center User 24 // Guide. 25 // 26 // [User authentications]: https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html 27 func (c *Client) Logout(ctx context.Context, params *LogoutInput, optFns ...func(*Options)) (*LogoutOutput, error) { 28 if params == nil { 29 params = &LogoutInput{} 30 } 31 32 result, metadata, err := c.invokeOperation(ctx, "Logout", params, optFns, c.addOperationLogoutMiddlewares) 33 if err != nil { 34 return nil, err 35 } 36 37 out := result.(*LogoutOutput) 38 out.ResultMetadata = metadata 39 return out, nil 40 } 41 42 type LogoutInput struct { 43 44 // The token issued by the CreateToken API call. For more information, see [CreateToken] in the 45 // IAM Identity Center OIDC API Reference Guide. 46 // 47 // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html 48 // 49 // This member is required. 50 AccessToken *string 51 52 noSmithyDocumentSerde 53 } 54 55 type LogoutOutput struct { 56 // Metadata pertaining to the operation's result. 57 ResultMetadata middleware.Metadata 58 59 noSmithyDocumentSerde 60 } 61 62 func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (err error) { 63 err = stack.Serialize.Add(&awsRestjson1_serializeOpLogout{}, middleware.After) 64 if err != nil { 65 return err 66 } 67 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpLogout{}, middleware.After) 68 if err != nil { 69 return err 70 } 71 72 if err = addComputeContentLength(stack); err != nil { 73 return err 74 } 75 if err = addResolveEndpointMiddleware(stack, options); err != nil { 76 return err 77 } 78 if err = addRecordResponseTiming(stack, options); err != nil { 79 return err 80 } 81 if err = addCredentialSource(stack, options); err != nil { 82 return err 83 } 84 if err = addOpLogoutValidationMiddleware(stack); err != nil { 85 return err 86 } 87 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 88 return err 89 } 90 if err = addResponseErrorMiddleware(stack); err != nil { 91 return err 92 } 93 if err = addRequestResponseLogging(stack, options); err != nil { 94 return err 95 } 96 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 97 return err 98 } 99 if err = addInterceptors(stack, options); err != nil { 100 return err 101 } 102 return nil 103 }