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

                              SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                              은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현