November 2018
Intermediate to advanced
404 pages
10h 16m
English
In order to use HTTP authentication, add package dependencies to the Swift Package Manager's manifest file, Package.swift:
....package(url: "https://github.com/vapor/auth.git", from: "2.0.0"),...dependencies: ["FluentPostgreSQL", "Vapor", "Leaf", "Authentication"]
Like enabling other services in Vapor, you then register AuthenticationProvider in configure.swift:
try services.register(AuthenticationProvider())
You then import the authentication package into configure.swift and any Swift files that use Authentication functions:
import Authentication
Read now
Unlock full access