swift-pkce

1.0.0

A simple Swift package for the PKCE OAuth 2.0 extension
hendrickson-tyler/swift-pkce

What's New

1.0.0

2022-02-25T22:36:06Z

Initial release:

  • Ability to generate a code verifier
  • Ability to generate a code challenge

Swift PKCE

Swift PKCE is a lightweight collection of commonly used, client-side code generations in an OAuth 2.0 Authorization Code flow + PKCE implemented in Swift. Each function conforms to the RFC 7636 protocol.

Availability

Due to the dependency on Apple CryptoKit, Swift PKCE is available to the following platforms:

iOS 13.0+
iPadOS 13.0+
macOS 10.15+
Mac Catalyst 15.0+
tvOS 15.0+
watchOS 8.0+

Usage

Import the Swift PKCE framework by adding it to the imports at the top of the file:

import PKCE

Functions

generateCodeVerifier
Generates a new, random code verifier with a specified length of characters.

func generateCodeVerifier(length: Int = 128) throws -> String {

generateCodeChallenge
Generates a code challenge for a given code verifier.

func generateCodeChallenge(for: String) throws -> String

Attribution

The original code for Swift PKCE was sourced from a Bootstragram blog post written by @dirtyhenry and updated slightly.

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Nov 25 2024 14:20:40 GMT-1000 (Hawaii-Aleutian Standard Time)