Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        


FirebaseJWTMiddleware



Vapor Version


Swift 5.2


MIT License

## 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)