https://github.com/rosberry/auth
Authentication with social networks
https://github.com/rosberry/auth
golang library
Last synced: over 1 year ago
JSON representation
Authentication with social networks
- Host: GitHub
- URL: https://github.com/rosberry/auth
- Owner: rosberry
- License: mit
- Created: 2020-09-09T05:23:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-29T09:40:47.000Z (over 4 years ago)
- Last Synced: 2025-01-31T13:42:54.375Z (over 1 year ago)
- Topics: golang, library
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Auth
Authentication with social networks, information about the user
## Supported:
- Apple
- Google
- Facebook
- VK
## Usage
### Input: token and auth type
```golang
import "github.com/rosberry/auth"
ud, err := auth.Auth(googleToken, auth.AuthTypeGoogle)
```
OR if you want check token audience:
```golang
import "github.com/rosberry/auth"
ud, err := auth.AuthWithCheckAUD(googleToken, audience, auth.AuthTypeGoogle)
```
Apple, Google: ```JWT token (id_token)```
Facebook, VK: ```access_token```
### Result: user details
```golang
UserDetails struct {
ID string
FirstName string
LastName string
UserName string
Email string
Picture string
}
```
### Important
- VK don't sent email in user information
- Apple don't include username (firstname and lastname) in JWT token
## About

This project is owned and maintained by [Rosberry](http://rosberry.com). We build mobile apps for users worldwide 🌏.
Check out our [open source projects](https://github.com/rosberry), read [our blog](https://medium.com/@Rosberry) or give us a high-five on 🐦 [@rosberryapps](http://twitter.com/RosberryApps).
## License
This project is available under the MIT license. See the LICENSE file for more info.