mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #664] App Crash when using ASWebAuthenticationSession in iOS 14.5 #432
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#432
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RahulTak on GitHub (Jun 10, 2021).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/664
Description:
File:
ASWebAuthenticationURLHandler.swiftMy app is crash when I am using the
Then Crash detail is
if I replace
callbackUrlSchemewithcallbackUrlScheme .addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)it's working fine.So please let me know how to add this lines into your package and use into my project.
Or should I have to create the new branch for this is send you the PR for merge into this?
OAuth Provider? (Twitter, Github, ..):
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
12.5 (Swift 5.0)
11.4 (Swift 5.2)
11.x (Swift 5.1)
10.x (Swift 5.0)
other: (Please fill in the version you are using.)
objective c
@phimage commented on GitHub (Jun 10, 2021):
you could show code with link
github.com/OAuthSwift/OAuthSwift@dbb74fa871/Sources/Handler/ASWebAuthenticationURLHandler.swift (L38)first yes
!forecast must be forbidden in OAuthSwift codeI see some edit about that recently, maybe it depend on swift version
@RahulTak commented on GitHub (Jun 10, 2021):
@phimage Yes forecast must be forbidden,
but my point is different That app crashing while creating the object of
ASWebAuthenticationSessionbecause in this we are sendingcallbackURLSchemenormally.But we required to send like this
callbackUrlScheme.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)I have tested this with my by cloning your package and made this changes@phimage commented on GitHub (Jun 10, 2021):
your value of
callbackURLSchemeis ?because you pass it , so you could encode it if very necessary (or not is based to ASWebAuthenticationSession is different)
if you put ":" or "/" in a scheme it's your error maybe?
@RahulTak commented on GitHub (Jun 10, 2021):
@phimage yes this is the problem, can you please help me to resolve this ?
@phatblat commented on GitHub (Jun 10, 2021):
@RahulTak are you passing a full URL as the callbackScheme? Your scheme should not contain a colon. ASWebAuthenticationSession used to only log an error if you passed a full URL as the scheme but as of 14.5 it crashes
@RahulTak commented on GitHub (Jun 10, 2021):
@phimage I am passing the URL like
myappSchemeName://authorizedcallbackbecause we need this while popup dismiss.@phimage commented on GitHub (Jun 10, 2021):
that's not a scheme.
an url is
scheme://host/path?query#fragment@RahulTak commented on GitHub (Jun 10, 2021):
But
myappSchemeName://authorizedcallbackthis is working fine into the iOS 14.4@phatblat commented on GitHub (Jun 10, 2021):
Yep, it worked for us too in 14.4, but check your logs for the error. What changed in 14.5 is that Apple is now crashing instead of just logging an error.