Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add support for custom scheme redirect URIs

Aperta
#272 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 7 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
swift

Direzione di ricerca

Start at validateRedirectURI in the OAuth flow and trace its callers and related URL-scheme definitions. Check existing validation coverage, then define completion as allowing the requested macOS and iOS custom-scheme callback URLs while preserving the current fragment and loopback-HTTP checks; verify the behavior with the relevant OAuth tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Is your feature request related to a problem? Please describe.
When using the OAuth flow in this package for a macOS desktop application, I can only redirect from the authorization flow to http or https URLs.

Describe the solution you'd like
On macOS and iOS it's natural to be able to redirect to apps via custom schemes they claim on the operating system. ASWebAuthenticationSession supports these directly: https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession/init(url:callback:completionhandler:)-6nut7

ASWebAuthenticationSession ensures that only the calling app’s session receives the authentication callback, even when more than one app registers the same callback URL scheme.

Additional context
Currently, only http and https schemes are supported:

public func validateRedirectURI(_ url: URL) throws {
        guard let components = URLComponents(url: url, resolvingAgainstBaseURL: false),
            let scheme = components.scheme?.lowercased(),
            components.fragment == nil
        else {
            throw OAuthAuthorizationError.invalidRedirectURI(url.absoluteString)
        }

        if scheme == OAuthURLScheme.https { return }

        if scheme == OAuthURLScheme.http,
            let host = components.host?.lowercased(),
            OAuthLoopbackHost.isLoopback(host)
        {
            return
        }

        throw OAuthAuthorizationError.invalidRedirectURI(url.absoluteString)
    }
Lingua principale
Swift
Stelle
1.5k
Fork
252
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/swift-sdk

Tutte le issue di modelcontextprotocol/swift-sdk

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.