Package cognitoidentity provides the client and types for making API requests to Amazon Cognito Identity. Amazon Cognito is a web service that delivers scoped temporary credentials to mobile devices and other untrusted environments. Amazon Cognito uniquely identifies a device and supplies the user with a consistent identity over the lifetime of an application. Using Amazon Cognito, you can enable authentication with one or more third-party identity providers (Facebook, Google, or Login with Amazon), and you can also choose to support unauthenticated access from your app. Cognito delivers a unique identifier for each user and acts as an OpenID token provider trusted by AWS Security Token Service (STS) to access temporary, limited-privilege AWS credentials. To provide end-user credentials, first make an unsigned call to GetId. If the end user is authenticated with one of the supported identity providers, set the Logins map with the identity provider token. GetId returns a unique identifier for the user. Next, make an unsigned call to GetCredentialsForIdentity. This call expects the same Logins map as the GetId call, as well as the IdentityID originally returned by GetId. Assuming your identity pool has been configured via the SetIdentityPoolRoles operation, GetCredentialsForIdentity will return AWS credentials for your use. If your pool has not been configured with SetIdentityPoolRoles, or if you want to follow legacy flow, make an unsigned call to GetOpenIdToken, which returns the OpenID token necessary to call STS and retrieve AWS credentials. This call expects the same Logins map as the GetId call, as well as the IdentityID originally returned by GetId. The token returned by GetOpenIdToken can be passed to the STS operation AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html) to retrieve AWS credentials. If you want to use Amazon Cognito in an Android, iOS, or Unity application, you will probably want to make API calls via the AWS Mobile SDK. To learn more, see the AWS Mobile SDK Developer Guide (http://docs.aws.amazon.com/mobile/index.html). See https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30 for more information on this service. See cognitoidentity package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/cognitoidentity/ To Amazon Cognito Identity with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently. See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/ See aws.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config See the Amazon Cognito Identity client CognitoIdentity for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/cognitoidentity/#New
Package facebook is a Go library fully supports Facebook Graph API (both 1.0 and 2.x) with file upload, batch request, FQL and multi-FQL. It can be used in Google App Engine. Library design is highly influenced by facebook official PHP/JS SDK. If you have experience with PHP/JS SDK, you may feel quite familiar with it. Go to project home page to see samples. Link: https://github.com/huandu/facebook This library doesn't implement any deprecated old RESTful API. And it won't.
Package auth provides a complete user authentication system for Go web applications. Quick Start: Features: 1. Email/Password Authentication 2. OAuth Support 3. SAML Single Sign-On Customizable User Info You can override the GetInfo method to return custom user information: type MyDB struct { *auth.UserDB } type CustomUserInfo struct { UserID int64 `json:"userid"` Email string `json:"email"` Name string `json:"name"` AvatarURL string `json:"avatar_url"` } func (db *MyDB) GetInfo(tx auth.Tx, userid int64, newAccount bool) auth.UserInfo { // Query additional user data from your database var info CustomUserInfo err := tx.(*auth.UserTx).Tx.Get(&info, `SELECT userid, email, name, avatar_url FROM users WHERE userid = ?`, userid) if err != nil { panic(err) } return info } // Use your custom DB: authHandler := auth.New(&MyDB{auth.NewUserDB(db)}, settings) API Endpoints: POST /user/auth - Sign in with email/password: email=user@example.com&password=secret - Sign in with OAuth: method=facebook&token=oauth-token - Sign in with SAML: email=user@company.com&sso=1 POST /user/create - Create account: email=user@example.com&password=secret - Optional signin=0 to create without signing in GET /user/get - Get current user info - Returns 401 if not signed in POST /user/signout - Sign out current user POST /user/update - Update email: email=new@example.com - Update password: password=newpassword POST /user/oauth/add - Add OAuth method: method=facebook&token=oauth-token - Optional update_email=true to update email POST /user/oauth/remove - Remove OAuth method: method=facebook POST /user/forgotpassword - Request password reset: email=user@example.com POST /user/resetpassword - Reset password: token=reset-token&password=newpassword GET /user/saml/metadata - Get SAML service provider metadata POST /user/saml/acs - SAML assertion consumer service endpoint Database Schema: The package automatically creates these tables: - Users: Basic user info and credentials - Sessions: Active login sessions - OAuth: Linked OAuth accounts - PasswordResetTokens: Password reset tokens - AuthSettings: Configuration settings See schema.go for complete table definitions. Security Features: - Passwords hashed with bcrypt - Rate limiting on authentication attempts - CSRF protection - Secure session cookies - SQL injection protection via sqlx Example_saml shows how to register Saml providers and override the GetSamlIdentityProviderForUser method
Package abide is a testing utility for http response snapshots inspired by Facebook's Jest. It is designed to be used alongside Go's existing testing package and enable broader coverage of http APIs. When included in version control it can provide a historical log of API and application changes over time. A snapshot is essentially a lockfile representing an http response. In addition to testing `http.Response`, abide provides methods for testing `io.Reader` and any object that implements `Assertable`. Snapshots are saved in a directory named __snapshots__ at the root of the package. These files are intended to be saved and included in version control. Snapshots are automatically generated during the initial test run. For example this will create a snapshot identified by "example" for this http.Response. In subsequent test runs the existing snapshot is compared to the new results. In the event they do not match, the test will fail, and the diff will be printed. If the change was intentional, the snapshot can be updated.
This is a Go library fully supports Facebook Graph API with file upload, batch request and FQL. It's simple but powerful. Library design is highly influenced by facebook official PHP/JS SDK. If you have used PHP/JS SDK, it should look familiar to you. Here is a list of common scenarios to help you to get started. Scenario 1: Read a graph `user` object without access token. Scenario 2: Read a graph `user` object with a valid access token. Scenario 3: Use App and Session struct. It's recommended to use them in a production app. Scenario 4: Read graph api response and decode result into a struct. Struct tag definition is compatible with the definition in `encoding/json`. Scenario 5: Send a batch request. For more detailed documents, see doc in every public method. I've try my best to provide enough information. Still not enough? Tell me or help me to improve wording by sending me Pull Request. This library doesn't implement any deprecated old RESTful API. And it won't.