Swiftpack.co - Package - vapor-community/Imperial


Imperial is a Federated Login service, allowing you to easily integrate your Vapor applications with OAuth providers to handle your apps authentication.


Author(s): @calebkleveter, @rafiki270


All code contained in the Imperial package is under the MIT license agreement.


Stars: 91


Used By

Total: 0


0.16.1 - 2020-08-25 14:41:25

Make the tenant ID for Microsoft configurable via an environment variable - #67

1.0.0 Beta 2 - 2020-07-31 07:23:01

Update the latest release to pull in changes and resolve #66

1.0.0-beta.1 - 2020-03-13 22:17:29

Fully updated for Vapor 4!

While there are no known major issues with this release at the time of this writing, it's too early to call this a release candidate. As a result, this version is being released as a pre-release and with a beta tag. At some point before RC, the 4 branch will me merged to master and a legacy support branch will spin off for the benefit of Vapor 3 users.

0.16.0 - 2020-03-05 03:20:55

Adds support for Dropbox via https://github.com/vapor-community/Imperial/pull/47

0.15.0 - 2020-02-12 16:54:08

Adds support for Microsoft Azure active directory via #48

0.14.0 - 2020-01-28 17:32:19

Adds support for Auth0 via #46

0.13.1 - 2019-09-03 12:18:56

Applying facebook scope parameters to OAuth request.

v0.13.0 - 2019-04-25 12:14:43

Keycloak Support

Adds support for the Keycloak API as a federated auth service. Checkout the setup guide!

0.12.0 - 2019-04-12 13:01:01

  • authURL now has request available to generate hashes
  • Added support for Gitlab

v0.11.3 - 2019-04-02 22:52:47

Fixes closures authenticatedCallback on linux by making them throwing

v0.11.2 - 2019-04-02 11:29:59

Correct Redirect Variable

The redirect variable used FederatedServiceRouter.configureRoutes method was overridden with the authVariable parameter. Use .self should fix that.

v0.11.1 - 2019-03-29 12:14:35

Throwing Authenticated Callback

Made the FederatedServiceRoute.configureRoutes authenticatedCallback closure throwing (https://github.com/vapor-community/Imperial/pull/31)

v0.11.0 - 2019-03-29 11:34:43

Authenticated Callback

Adds and authenticatedCallback to the FederatedServiceRoute.configureRoutes method (https://github.com/vapor-community/Imperial/pull/30).

v0.10.0 - 2019-03-26 16:09:39

Configurable Env Vars

Made the token struct environment variable names configurable by making them static.

v0.9.1 - 2019-03-18 12:16:19

Shopify Upgrades

  • Cleaned up docs and refactored Shopify auth implementation (https://github.com/vapor-community/Imperial/pull/25)

v0.9.0 - 2019-01-31 16:15:56

Facebook Integration

Checkout the guide here!

v0.8.0 - 2019-01-11 12:46:03

Shopify Auth

Adds support for the Shopify OAuth API. To set it up, read the guide here.

v0.7.3 - 2018-12-25 13:18:00

URL Encoded Spaces

The scope query string parameters in the Google and GitHub routers used raw space characters (), which sometimes caused the URL to break. Theses have been replaced with URL encoded spaces (%20), so they should always work now.

0.7.2 - 2018-11-18 11:57:21

Imperial 0.7.2

  • #20 Fix compiler warning in Google JWT Router

v0.7.1 - 2018-08-18 20:49:20


Updated JWT package version to 3.0! Something else might have been fixed also 🤔. Not sure.

v0.7.0 - 2018-06-06 21:57:04

Server-to-Server with Google

You can now do Server-to-Server auth with Google. No guide yet. You can roughly follow the other Google auth guide to get an idea of what you are supposed to do.

You can now get a token without hitting a route using:

FederatedServiceRouter(callback: "") { req, _ in req.makeResponse() }.fetchToken(from: request)

v0.6.0 - 2018-04-02 21:59:42


Take the red pill. It's worth it.

v0.5.3 - 2018-03-19 22:04:37

Vapor 3

Imperial and its documentation has been updated for Vapor 3 RC. Have fun!

v0.4.0 - 2018-01-20 21:11:14

Vapor 3

Now ported to Vapor 3! Use version 0.3.0 if you are on Vapor 2.

You can now conform to FederatedCreatable so you can create an instance of a model from a service and store it in a session:

let user = request.create(User.self, from: .github)
let user = request.fetch(User.self)

(This is how it is supposed to work. Haven't tested it yet 😉.)

v0.3.0 - 2017-11-14 20:13:09

Google Auth

Federated Login with Google is now implemented!

v0.2.0 - 2017-11-13 18:02:46


Imperial Middleware is now ready, allowing you to protect routes that require authentication and to redirect a user if they try to access a protected route.

v0.1.0 - 2017-11-13 18:01:11

GitHub Auth

Federated Login with GitHub is now available!