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;








2















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

)

)









share|improve this question
































    2















    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

    )

    )









    share|improve this question




























      2












      2








      2


      1






      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

      )

      )









      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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

























          2 Answers
          2






          active

          oldest

          votes


















          1
















          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











          share|improve this answer


































            1
















            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.






            share|improve this answer



























              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
              );



              );














              draft saved

              draft discarded
















              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









              1
















              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











              share|improve this answer































                1
















                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











                share|improve this answer





























                  1














                  1










                  1









                  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











                  share|improve this answer















                  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












                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  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


























                      1
















                      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.






                      share|improve this answer





























                        1
















                        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.






                        share|improve this answer



























                          1














                          1










                          1









                          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.






                          share|improve this answer













                          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.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 1 at 21:55









                          Yue WangYue Wang

                          111 bronze badge




                          111 bronze badge































                              draft saved

                              draft discarded















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                              Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                              Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript