Firebase does not show up sign page for microsoft.com in Swift / iOSHow to implement Firebase Microsoft OAuth in iOS Swift?How do I call Objective-C code from Swift?#pragma mark in Swift?Split a String into an array in Swift?Firebase 3: creating a custom authentication token using .net and c#Firebase startup with ionic and angular jsiOS error with Firebase Auth Sign In using Twitter credentialsFirebase, relogin automatically usin REST servicesSwift Firebase getIDToken() crash with Google credentialAuthenticate using only username and password with firestore in AndroidFirebase - Getting OAuth Credentials to REST Auth
How often is duct tape used during crewed space missions?
Is it safe to unplug a blinking USB drive after 'safely' ejecting it?
All numbers in a 5x5 Minesweeper grid
Why are two-stroke engines nearly unheard of in aviation?
Twelve Minesweeper mines that make twelve 4s
Integrability of log of distance function
Manager manipulates my leaves, what's in it for him?
Which museums have artworks of all four ninja turtles' namesakes?
Make Interviewee Comfortable in Potentially Intimate Environment
How to ask a man to not take up more than one seat on public transport while avoiding conflict?
Is Zack Morris's 'time stop' ability in "Saved By the Bell" a supernatural ability?
Why can't we use uninitialized local variable to access static content of its type?
Do the villains know Batman has no superpowers?
Who was Chief Poking Fire?
Convert dictionaries with list of values into a dataframe
Can I separate garlic into cloves for storage?
Is there any reason nowadays to use a neon indicator lamp instead of a LED?
Very lazy puppy
What is the rail connection between Paris Charles de Gaulle Airport and Gare de Lyon like?
Is the name of an interval between two notes unique and absolute?
Regular Expressions with `<` and `?` strange matches
Why was Java 8 left out from Debian Buster?
I was cheated into a job and want to leave ASAP, what do I tell my interviewers?
Is it safe to put a microwave in a walk-in closet?
Firebase does not show up sign page for microsoft.com in Swift / iOS
How to implement Firebase Microsoft OAuth in iOS Swift?How do I call Objective-C code from Swift?#pragma mark in Swift?Split a String into an array in Swift?Firebase 3: creating a custom authentication token using .net and c#Firebase startup with ionic and angular jsiOS error with Firebase Auth Sign In using Twitter credentialsFirebase, relogin automatically usin REST servicesSwift Firebase getIDToken() crash with Google credentialAuthenticate using only username and password with firestore in AndroidFirebase - Getting OAuth Credentials to REST Auth
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am implementing the Firebase authentication by using OAuthProvider class to sign in with a personal microsoft account.
I have followed this instructions: https://firebase.google.com/docs/auth/ios/microsoft-oauth?authuser=0
However when I am using OAuthProvider of Firebase SDK it does not show up the sign in page of Microsoft, actually nothing gets invoked by getCredentialWith.
When I am using GoogleAuthProvider everything works fine and Firebase SDK shows up the sign in page of Google.
let provider = OAuthProvider(providerID: "microsoft.com")
provider.scopes = ["files.readwrite.appfolder", "user.read"]
provider.getCredentialWith(nil, completion: credential, error in
if let error = error
os_log("Firebase Error: %@", type: .fault, error as CVarArg)
return
if (credential != nil)
Auth.auth().signInAndRetrieveData(with: credential!, completion: authResult, error in
if let error = error
os_log("Firebase Error: %@", type: .fault, error as CVarArg)
return
)
)
ios swift firebase firebase-authentication
add a comment
|
I am implementing the Firebase authentication by using OAuthProvider class to sign in with a personal microsoft account.
I have followed this instructions: https://firebase.google.com/docs/auth/ios/microsoft-oauth?authuser=0
However when I am using OAuthProvider of Firebase SDK it does not show up the sign in page of Microsoft, actually nothing gets invoked by getCredentialWith.
When I am using GoogleAuthProvider everything works fine and Firebase SDK shows up the sign in page of Google.
let provider = OAuthProvider(providerID: "microsoft.com")
provider.scopes = ["files.readwrite.appfolder", "user.read"]
provider.getCredentialWith(nil, completion: credential, error in
if let error = error
os_log("Firebase Error: %@", type: .fault, error as CVarArg)
return
if (credential != nil)
Auth.auth().signInAndRetrieveData(with: credential!, completion: authResult, error in
if let error = error
os_log("Firebase Error: %@", type: .fault, error as CVarArg)
return
)
)
ios swift firebase firebase-authentication
add a comment
|
I am implementing the Firebase authentication by using OAuthProvider class to sign in with a personal microsoft account.
I have followed this instructions: https://firebase.google.com/docs/auth/ios/microsoft-oauth?authuser=0
However when I am using OAuthProvider of Firebase SDK it does not show up the sign in page of Microsoft, actually nothing gets invoked by getCredentialWith.
When I am using GoogleAuthProvider everything works fine and Firebase SDK shows up the sign in page of Google.
let provider = OAuthProvider(providerID: "microsoft.com")
provider.scopes = ["files.readwrite.appfolder", "user.read"]
provider.getCredentialWith(nil, completion: credential, error in
if let error = error
os_log("Firebase Error: %@", type: .fault, error as CVarArg)
return
if (credential != nil)
Auth.auth().signInAndRetrieveData(with: credential!, completion: authResult, error in
if let error = error
os_log("Firebase Error: %@", type: .fault, error as CVarArg)
return
)
)
ios swift firebase firebase-authentication
I am implementing the Firebase authentication by using OAuthProvider class to sign in with a personal microsoft account.
I have followed this instructions: https://firebase.google.com/docs/auth/ios/microsoft-oauth?authuser=0
However when I am using OAuthProvider of Firebase SDK it does not show up the sign in page of Microsoft, actually nothing gets invoked by getCredentialWith.
When I am using GoogleAuthProvider everything works fine and Firebase SDK shows up the sign in page of Google.
let provider = OAuthProvider(providerID: "microsoft.com")
provider.scopes = ["files.readwrite.appfolder", "user.read"]
provider.getCredentialWith(nil, completion: credential, error in
if let error = error
os_log("Firebase Error: %@", type: .fault, error as CVarArg)
return
if (credential != nil)
Auth.auth().signInAndRetrieveData(with: credential!, completion: authResult, error in
if let error = error
os_log("Firebase Error: %@", type: .fault, error as CVarArg)
return
)
)
ios swift firebase firebase-authentication
ios swift firebase firebase-authentication
edited Mar 28 at 15:30
KENdi
6,1322 gold badges10 silver badges22 bronze badges
6,1322 gold badges10 silver badges22 bronze badges
asked Mar 28 at 14:13
Andreas ReuterAndreas Reuter
153 bronze badges
153 bronze badges
add a comment
|
add a comment
|
2 Answers
2
active
oldest
votes
Declare in global scope like below
var provider: OAuthProvider?
var authMicrosoft: Auth?
@IBAction func buttonTapped(_ sender: Any)
provider = OAuthProvider(providerID: "microsoft.com")
provider?.customParameters = [
"prompt": "consent",
"login_hint": "",
]
provider?.scopes = ["mail.read", "calendars.read"]
provider?.getCredentialWith(nil ) credential, error in
if error != nil
// Handle error.
print(credential?.provider)
if let x = credential
self. authMicrosoft?.signIn(with: x) authResult, error in
if error != nil
// Handle error.
print(authResult?.additionalUserInfo?.profile)
print(authResult?.user.providerID)
else
add a comment
|
It seems that you define a provider locally. While the getCredentialWith(_:completion) call gets executed asynchronously, your local function may already finished executing, and the provider may already be deallocated by ARC.
To solve your problem, you may need to specifically retain the provider pointer somewhere --- for instance in your view controller as a property or ivar, and by that way the provider can be created/recycled when your view controller is initialized/deallocated.
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55399758%2ffirebase-does-not-show-up-sign-page-for-microsoft-com-in-swift-ios%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Declare in global scope like below
var provider: OAuthProvider?
var authMicrosoft: Auth?
@IBAction func buttonTapped(_ sender: Any)
provider = OAuthProvider(providerID: "microsoft.com")
provider?.customParameters = [
"prompt": "consent",
"login_hint": "",
]
provider?.scopes = ["mail.read", "calendars.read"]
provider?.getCredentialWith(nil ) credential, error in
if error != nil
// Handle error.
print(credential?.provider)
if let x = credential
self. authMicrosoft?.signIn(with: x) authResult, error in
if error != nil
// Handle error.
print(authResult?.additionalUserInfo?.profile)
print(authResult?.user.providerID)
else
add a comment
|
Declare in global scope like below
var provider: OAuthProvider?
var authMicrosoft: Auth?
@IBAction func buttonTapped(_ sender: Any)
provider = OAuthProvider(providerID: "microsoft.com")
provider?.customParameters = [
"prompt": "consent",
"login_hint": "",
]
provider?.scopes = ["mail.read", "calendars.read"]
provider?.getCredentialWith(nil ) credential, error in
if error != nil
// Handle error.
print(credential?.provider)
if let x = credential
self. authMicrosoft?.signIn(with: x) authResult, error in
if error != nil
// Handle error.
print(authResult?.additionalUserInfo?.profile)
print(authResult?.user.providerID)
else
add a comment
|
Declare in global scope like below
var provider: OAuthProvider?
var authMicrosoft: Auth?
@IBAction func buttonTapped(_ sender: Any)
provider = OAuthProvider(providerID: "microsoft.com")
provider?.customParameters = [
"prompt": "consent",
"login_hint": "",
]
provider?.scopes = ["mail.read", "calendars.read"]
provider?.getCredentialWith(nil ) credential, error in
if error != nil
// Handle error.
print(credential?.provider)
if let x = credential
self. authMicrosoft?.signIn(with: x) authResult, error in
if error != nil
// Handle error.
print(authResult?.additionalUserInfo?.profile)
print(authResult?.user.providerID)
else
Declare in global scope like below
var provider: OAuthProvider?
var authMicrosoft: Auth?
@IBAction func buttonTapped(_ sender: Any)
provider = OAuthProvider(providerID: "microsoft.com")
provider?.customParameters = [
"prompt": "consent",
"login_hint": "",
]
provider?.scopes = ["mail.read", "calendars.read"]
provider?.getCredentialWith(nil ) credential, error in
if error != nil
// Handle error.
print(credential?.provider)
if let x = credential
self. authMicrosoft?.signIn(with: x) authResult, error in
if error != nil
// Handle error.
print(authResult?.additionalUserInfo?.profile)
print(authResult?.user.providerID)
else
edited May 13 at 22:53
zmag
3,6444 gold badges17 silver badges27 bronze badges
3,6444 gold badges17 silver badges27 bronze badges
answered May 13 at 22:25
yug kyug k
1321 silver badge5 bronze badges
1321 silver badge5 bronze badges
add a comment
|
add a comment
|
It seems that you define a provider locally. While the getCredentialWith(_:completion) call gets executed asynchronously, your local function may already finished executing, and the provider may already be deallocated by ARC.
To solve your problem, you may need to specifically retain the provider pointer somewhere --- for instance in your view controller as a property or ivar, and by that way the provider can be created/recycled when your view controller is initialized/deallocated.
add a comment
|
It seems that you define a provider locally. While the getCredentialWith(_:completion) call gets executed asynchronously, your local function may already finished executing, and the provider may already be deallocated by ARC.
To solve your problem, you may need to specifically retain the provider pointer somewhere --- for instance in your view controller as a property or ivar, and by that way the provider can be created/recycled when your view controller is initialized/deallocated.
add a comment
|
It seems that you define a provider locally. While the getCredentialWith(_:completion) call gets executed asynchronously, your local function may already finished executing, and the provider may already be deallocated by ARC.
To solve your problem, you may need to specifically retain the provider pointer somewhere --- for instance in your view controller as a property or ivar, and by that way the provider can be created/recycled when your view controller is initialized/deallocated.
It seems that you define a provider locally. While the getCredentialWith(_:completion) call gets executed asynchronously, your local function may already finished executing, and the provider may already be deallocated by ARC.
To solve your problem, you may need to specifically retain the provider pointer somewhere --- for instance in your view controller as a property or ivar, and by that way the provider can be created/recycled when your view controller is initialized/deallocated.
answered Apr 1 at 21:55
Yue WangYue Wang
111 bronze badge
111 bronze badge
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55399758%2ffirebase-does-not-show-up-sign-page-for-microsoft-com-in-swift-ios%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown