Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/barisatamer/vapor-firebase-jwt-middleware
Vapor 4 Middleware for verifying Firebase ID tokens
https://github.com/barisatamer/vapor-firebase-jwt-middleware
firebase-auth jwt-middleware vapor-3 vapor-4 vapor-swift
Last synced: about 1 month ago
JSON representation
Vapor 4 Middleware for verifying Firebase ID tokens
- Host: GitHub
- URL: https://github.com/barisatamer/vapor-firebase-jwt-middleware
- Owner: barisatamer
- Created: 2019-08-24T09:34:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-01T13:02:33.000Z (over 2 years ago)
- Last Synced: 2023-02-28T18:52:22.593Z (almost 2 years ago)
- Topics: firebase-auth, jwt-middleware, vapor-3, vapor-4, vapor-swift
- Language: Swift
- Homepage:
- Size: 25.4 KB
- Stars: 17
- Watchers: 4
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Installation 📦
To include it in your package, add the following to your `Package.swift` file.
```swift
let package = Package(
name: "Project",
dependencies: [
...
.package(name: "FirebaseJWTMiddleware", url: "https://github.com/barisatamer/vapor-firebase-jwt-middleware.git", from: "1.0.0"),
],
targets: [
.target(name: "App", dependencies: [
.product(name: "FirebaseJWTMiddleware", package: "FirebaseJWTMiddleware"),
...
])
]
)
```## Usage 🚀
1. **Configure Project ID**
```swift
app.firebaseJwt.applicationIdentifier =
```
2. **Import header files**```swift
import FirebaseJWTMiddleware
```3. **Adding Middleware to a Routing Group**
```swift
let group = router.grouped(FirebaseJWTMiddleware())
group.get("welcome") { req in
return "Hello, world!"
}
```## References
- [Verifying Firebase ID Tokens](https://firebase.google.com/docs/auth/admin/verify-id-tokens?authuser=1)