Lightweight OAuth 2.0 Client with PKCE (Proof key for Code Exchange: see RFC 7636)
OAuth2Client().signIn(request: request)
.receive(on: yourQueue)
.sink(receiveCompletion: { (completion) in
}, receiveValue: { (credential) in
credential.save()
})
Credential.load()
OAuth2Client().refresh(request: request)
.receive(on: yourQueue)
.sink(receiveCompletion: { (completion) in
}, receiveValue: { (credential) in
credential.save()
})
Removing cache on WebKit, and showing new auth screen.
OAuth2Client().signOut(request: request)
.receive(on: yourQueue)
.sink(receiveCompletion: { (completion) in
}, receiveValue: { (credential) in
credential.save()
})
- Supporting OAuth 2.0 with PKCE
- Publish / refresh access token
- Combine interface
- Make sure setting callback url scheme on your setting
- macOS v11.0 and later
- iOS / iPadOS v14.0 and later
Only support via Swift package manager installation.
dependencies: [
.package(url: "https://github.com/d-date/OAuth2Client.git", from: "0.1.0")
]