Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,21 +229,12 @@ jobs:
strategy:
matrix:
include:
- destination: "platform=iOS Simulator,OS=16.4,name=iPhone 14 Pro Max"
xcode_version: "15.4"
os: macos-14-large
- destination: "platform=iOS Simulator,OS=18.2,name=iPhone 16 Pro Max"
xcode_version: "16.2"
os: macos-15
- destination: "platform=iOS Simulator,OS=18.5,name=iPhone 16 Pro Max"
- destination: "platform=iOS Simulator,OS=18.6,name=iPhone 16 Pro Max"
xcode_version: "16.4"
os: macos-15
- destination: "platform=tvOS Simulator,OS=18.5,name=Apple TV"
xcode_version: "16.4"
os: macos-15
- destination: "platform=visionOS Simulator,OS=1.0,name=Apple Vision Pro"
xcode_version: "15.4"
os: macos-14
- destination: "platform=visionOS Simulator,OS=2.5,name=Apple Vision Pro"
xcode_version: "16.4"
os: macos-15
Expand All @@ -253,6 +244,9 @@ jobs:
- destination: "platform=macOS,name=My Mac"
xcode_version: "16.4"
os: macos-15
- destination: "platform=macOS,name=My Mac"
xcode_version: "26.0"
os: macos-15
runs-on: ${{ matrix.os }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer
Expand Down
2 changes: 1 addition & 1 deletion OktaAuthFoundation.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "OktaAuthFoundation"
s.module_name = "AuthFoundation"
s.version = "2.1.0"
s.version = "2.1.1"
s.summary = "Okta Authentication Foundation"
s.description = <<-DESC
Provides the foundation and common features used to authenticate users, managing the lifecycle and storage of tokens and credentials, and provide a base for other Okta SDKs to build upon.
Expand Down
2 changes: 1 addition & 1 deletion OktaBrowserSignin.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "OktaBrowserSignin"
s.module_name = "BrowserSignin"
s.version = "2.1.0"
s.version = "2.1.1"
s.summary = "Okta Browser Sign In UI"
s.description = <<-DESC
Authenticate users using web-based OIDC.
Expand Down
2 changes: 1 addition & 1 deletion OktaClient.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "OktaClient"
s.version = "2.1.0"
s.version = "2.1.1"
s.summary = "Secure client authentication, request authorization, and user management capabilities for Swift."
s.description = <<-DESC
Provides a modularized set of libraries that provide the building blocks and convenience features used to authenticate users, manage the lifecycle and storage of tokens and user credentials, and provide a base for other libraries and applications to build upon.
Expand Down
2 changes: 1 addition & 1 deletion OktaDirectAuth.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "OktaDirectAuth"
s.version = "2.1.0"
s.version = "2.1.1"
s.summary = "Okta Direct Authentication"
s.description = <<-DESC
Enables application developers to build native sign in experiences using the Okta Direct Authentication API.
Expand Down
2 changes: 1 addition & 1 deletion OktaIdxAuth.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'OktaIdxAuth'
s.version = '2.1.0'
s.version = '2.1.1'
s.summary = 'SDK to easily integrate the Okta Identity Engine'
s.description = <<-DESC
Integrate your native app with Okta using the Okta Identity Engine library.
Expand Down
2 changes: 1 addition & 1 deletion OktaOAuth2.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "OktaOAuth2"
s.module_name = "OAuth2Auth"
s.version = "2.1.0"
s.version = "2.1.1"
s.summary = "Okta OAuth2 Authentication"
s.description = <<-DESC
Enables application developers to authenticate users utilizing a variety of OAuth2 authentication flows.
Expand Down
2 changes: 1 addition & 1 deletion Sources/AuthFoundation/JWT/Protocols/Claim.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import Foundation

/// Indicates a type that can be used as an enum value for the ``HasClaims/ClaimType`` associated type.
public protocol IsClaim: RawRepresentable<String> {}
public protocol IsClaim: RawRepresentable<String>, Sendable, Hashable, Equatable {}

/// Used by classes that contains OAuth2 claims.
///
Expand Down
2 changes: 1 addition & 1 deletion Sources/AuthFoundation/Version+AuthFoundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ extension SDKVersion.Name {
extension SDKVersion {
@_documentation(visibility: private)
public static let authFoundation: SDKVersion? = {
register(.authFoundation, version: "2.1.0")
register(.authFoundation, version: "2.1.1")
}()
}
50 changes: 28 additions & 22 deletions Sources/BrowserSignin/BrowserSignin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,25 @@ public final class BrowserSignin {
scope: ClaimCollection<[String]>,
redirectUri: URL,
logoutRedirectUri: URL? = nil,
additionalParameters: [String: any APIRequestArgument]? = nil) throws
additionalParameters: [String: any APIRequestArgument]? = nil)
{
let client = OAuth2Client(issuerURL: issuerURL,
clientId: clientId,
scope: scope,
redirectUri: redirectUri,
logoutRedirectUri: logoutRedirectUri)
try self.init(client: client, additionalParameters: additionalParameters)
let loginFlow = AuthorizationCodeFlow(issuerURL: issuerURL,
clientId: clientId,
scope: scope,
redirectUri: redirectUri,
logoutRedirectUri: logoutRedirectUri,
additionalParameters: additionalParameters)
let client = loginFlow.client

let logoutFlow: SessionLogoutFlow?
if client.configuration.logoutRedirectUri != nil {
logoutFlow = SessionLogoutFlow(client: client,
additionalParameters: additionalParameters)
} else {
logoutFlow = nil
}

self.init(loginFlow: loginFlow, logoutFlow: logoutFlow)
}

@_documentation(visibility: private)
Expand All @@ -241,34 +252,29 @@ public final class BrowserSignin {
scope: some WhitespaceSeparated,
redirectUri: URL,
logoutRedirectUri: URL? = nil,
additionalParameters: [String: any APIRequestArgument]? = nil) throws
additionalParameters: [String: any APIRequestArgument]? = nil)
{
let client = OAuth2Client(issuerURL: issuerURL,
clientId: clientId,
scope: scope,
redirectUri: redirectUri,
logoutRedirectUri: logoutRedirectUri)
try self.init(client: client, additionalParameters: additionalParameters)
self.init(issuerURL: issuerURL,
clientId: clientId,
scope: .init(wrappedValue: scope.whitespaceSeparated),
redirectUri: redirectUri,
logoutRedirectUri: logoutRedirectUri,
additionalParameters: additionalParameters)
}

convenience init(_ config: OAuth2Client.PropertyListConfiguration) throws {
try self.init(client: OAuth2Client(config),
additionalParameters: config.additionalParameters)
}

convenience init(client: OAuth2Client, additionalParameters: [String: any APIRequestArgument]?) throws {
let client = try OAuth2Client(config)
let loginFlow = try AuthorizationCodeFlow(client: client,
additionalParameters: additionalParameters)
additionalParameters: config.additionalParameters)
let logoutFlow: SessionLogoutFlow?
if client.configuration.logoutRedirectUri != nil {
logoutFlow = SessionLogoutFlow(client: client,
additionalParameters: additionalParameters)
additionalParameters: config.additionalParameters)
} else {
logoutFlow = nil
}

self.init(loginFlow: loginFlow, logoutFlow: logoutFlow)

}

Comment thread
AlexNachbaur marked this conversation as resolved.
/// Initializes a web authentication session using the supplied AuthorizationCodeFlow and optional context.
Expand Down
2 changes: 1 addition & 1 deletion Sources/BrowserSignin/Version+BrowserSignin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ extension SDKVersion.Name {
extension SDKVersion {
@_documentation(visibility: private)
public static let browserSignin: SDKVersion? = {
register(.browserSignin, version: "2.1.0")
register(.browserSignin, version: "2.1.1")
}()
}
9 changes: 7 additions & 2 deletions Sources/OAuth2Auth/Authentication/AuthorizationCodeFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,21 @@ public actor AuthorizationCodeFlow: AuthenticationFlow {
/// - clientId: The client ID.
/// - scope: The scopes to request.
/// - redirectUri: The redirect URI for the client.
/// - logoutRedirectUri: The logout URI for the client, if applicable.
/// - additionalParameters: Optional additional query string parameters you would like to supply to the authorization server.
@inlinable
public init(issuerURL: URL,
clientId: String,
scope: ClaimCollection<[String]>,
redirectUri: URL,
logoutRedirectUri: URL? = nil,
additionalParameters: [String: any APIRequestArgument]? = nil)
{
self.init(verifiedClient: OAuth2Client(issuerURL: issuerURL,
clientId: clientId,
scope: scope,
redirectUri: redirectUri),
redirectUri: redirectUri,
logoutRedirectUri: logoutRedirectUri),
additionalParameters: additionalParameters)
}

Expand All @@ -109,12 +112,14 @@ public actor AuthorizationCodeFlow: AuthenticationFlow {
clientId: String,
scope: some WhitespaceSeparated,
redirectUri: URL,
logoutRedirectUri: URL? = nil,
additionalParameters: [String: any APIRequestArgument]? = nil)
{
self.init(verifiedClient: OAuth2Client(issuerURL: issuerURL,
clientId: clientId,
scope: .init(wrappedValue: scope.whitespaceSeparated),
redirectUri: redirectUri),
redirectUri: redirectUri,
logoutRedirectUri: logoutRedirectUri),
additionalParameters: additionalParameters)
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/OAuth2Auth/Version+OAuth2Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ extension SDKVersion.Name {
extension SDKVersion {
@_documentation(visibility: private)
public static let oauth2: SDKVersion? = {
register(.oauth2, version: "2.1.0")
register(.oauth2, version: "2.1.1")
}()
}
2 changes: 1 addition & 1 deletion Sources/OktaDirectAuth/Version+OktaDirectAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ extension SDKVersion.Name {
extension SDKVersion {
@_documentation(visibility: private)
public static let directAuth: SDKVersion? = {
register(.directAuth, version: "2.1.0")
register(.directAuth, version: "2.1.1")
}()
}
2 changes: 1 addition & 1 deletion Sources/OktaIdxAuth/Version+OktaIdxAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ extension SDKVersion.Name {
extension SDKVersion {
@_documentation(visibility: private)
public static let oktaIdx: SDKVersion? = {
register(.oktaIdx, version: "2.1.0")
register(.oktaIdx, version: "2.1.1")
}()
}
18 changes: 11 additions & 7 deletions Tests/BrowserSigninTests/BrowserSigninFlowTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ class BrowserSigninFlowTests: XCTestCase {

@MainActor
func testStart() async throws {
let webAuth = try BrowserSignin(client: client,
additionalParameters: ["testName": name])
let loginFlow = try AuthorizationCodeFlow(client: client,
additionalParameters: ["testName": name])
let webAuth = BrowserSignin(loginFlow: loginFlow, logoutFlow: nil)

try await BrowserSigninProviderFactoryMock.register(
result: .success(URL(string: "com.example:/callback?state=qwe&code=the_auth_code")!),
Expand All @@ -87,8 +88,11 @@ class BrowserSigninFlowTests: XCTestCase {

@MainActor
func testLogout() async throws {
let webAuth = try BrowserSignin(client: client,
additionalParameters: ["testName": name])
let loginFlow = try AuthorizationCodeFlow(client: client,
additionalParameters: ["testName": name])
let logoutFlow = SessionLogoutFlow(client: loginFlow.client,
additionalParameters: loginFlow.additionalParameters)
let webAuth = BrowserSignin(loginFlow: loginFlow, logoutFlow: logoutFlow)

try await BrowserSigninProviderFactoryMock.register(
result: .success(URL(string: "com.example:/logout?state=qwe")!),
Expand All @@ -114,9 +118,9 @@ class BrowserSigninFlowTests: XCTestCase {
}

func testCancel() async throws {
let webAuth = try await BrowserSignin(
client: client,
additionalParameters: ["testName": name])
let loginFlow = try AuthorizationCodeFlow(client: client,
additionalParameters: ["testName": name])
let webAuth = await BrowserSignin(loginFlow: loginFlow, logoutFlow: nil)

try await BrowserSigninProviderFactoryMock.register(
result: .failure(NSError(domain: ASWebAuthenticationSessionErrorDomain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BrowserSigninInitializerTests: XCTestCase {
private let logoutRedirectUri = URL(string: "com.example:/logout")!

func testInitializer() async throws {
let auth = try await BrowserSignin(
let auth = await BrowserSignin(
issuerURL: issuer,
clientId: "client_id",
scope: "openid profile",
Expand Down
Loading