質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Firebase Authentication

Firebase Authenticationは、Firebaseを利用したユーザーの認証機能です。バックエンドサービス、SDK、アプリでのユーザー認証に使用できるUIライブラリが用意されています。

Twitter

Twitterは、140文字以内の「ツイート」と呼ばれる短文を投稿できるサービスです。Twitter上のほぼ全ての機能に対応するAPIが存在し、その関連サービスが多く公開されています。

ログイン

ログインは、ユーザーがコンピューターシステムにアクセスするプロセスの事を呼びます。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

Q&A

0回答

1169閲覧

TwitterログインでFirebaseエラーが出る

momokoko

総合スコア38

Firebase Authentication

Firebase Authenticationは、Firebaseを利用したユーザーの認証機能です。バックエンドサービス、SDK、アプリでのユーザー認証に使用できるUIライブラリが用意されています。

Twitter

Twitterは、140文字以内の「ツイート」と呼ばれる短文を投稿できるサービスです。Twitter上のほぼ全ての機能に対応するAPIが存在し、その関連サービスが多く公開されています。

ログイン

ログインは、ユーザーがコンピューターシステムにアクセスするプロセスの事を呼びます。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

0グッド

0クリップ

投稿2020/11/07 09:49

編集2020/11/07 13:53

環境
macOS Catalina(10.15.6)
xcode(12.1)
シミュレーターではなく実機でビルドしています。

twitterのログインを以下の記事を見て実装しました。

リンク内容

// ViewController.swift // Swift5FacebookLoginWithFirebase import UIKit import FBSDKCoreKit import FBSDKLoginKit import FacebookCore import FacebookLogin import Firebase class ViewController: UIViewController,LoginButtonDelegate { var provider = OAuthProvider(providerID: "twitter.com") let twitterBtn: UIButton = { let button = UIButton(type: .system) button.setTitle("Twitter", for: .normal) button.setTitleColor(.white, for: .normal) button.backgroundColor = UIColor(red: 149/255, green: 204/255, blue: 244/255, alpha: 1) button.layer.cornerRadius = 5 button.addTarget(self, action: #selector(handleSignUp), for: .touchUpInside) return button }() override func viewDidLoad() { super.viewDidLoad() twitterBtn.frame = CGRect(x: view.frame.size.width/2 - view.frame.size.width/4, y: view.frame.size.height/2, width: view.frame.size.width/2, height: 30) view.addSubview(twitterBtn) } @objc func handleSignUp() { self.provider.getCredentialWith(nil) { credential, error in if error != nil { print("エラー1") print(error) } if credential != nil { Auth.auth().signIn(with: credential!) { result, error in if error != nil { print("エラー2") } print("sign in succeeded.") if let credential = result?.credential as? OAuthCredential, let accessToken = credential.accessToken, let secret = credential.secret { print("accessToken :" + accessToken) print("secret :" + secret) } // User is signed in. // IdP data available in authResult.additionalUserInfo.profile. // Twitter OAuth access token can also be retrieved by: // authResult.credential.accessToken // Twitter OAuth ID token can be retrieved by calling: // authResult.credential.idToken // Twitter OAuth secret can be retrieved by calling: // authResult.credential.secret } } } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) navigationController?.isNavigationBarHidden = true } }

Twitterボタンを押すと
イメージ説明
上記のようにwebには飛ばされるものの、すぐに前の画面に戻ってしまい以下のようなエラーが出てしまいます。

コンソール上のエラー

エラー1 Optional(Error Domain=FIRAuthErrorDomain Code=17063 "The app verification process has failed, print and inspect the error details for more information" UserInfo={FIRAuthErrorUserInfoNameKey=ERROR_WEB_USER_INTERACTION_FAILURE, NSLocalizedFailureReason=[auth/operation-not-allowed] - The identity provider configuration is not found., NSLocalizedDescription=The app verification process has failed, print and inspect the error details for more information})

やったこと
・twitterログインを参考にした記事に記載されていたエラー対処(SceneDelegateへの追記)

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). } func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { for urlContext in URLContexts { let url = urlContext.url Auth.auth().canHandle(url) } }

・Twitter Appの作り直し

いずれの対処後も同じエラー文が出てしまいました。

自分ではどのように直したらいいかわからない状態です。
ご教授いただけたら嬉しいです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問