LoginSignup
13
3

More than 5 years have passed since last update.

Auth0でログインしようとするとCORSでエラーが起きる問題

Posted at

Auth0を利用してログインしようとすると、以下のようなエラーを吐かれることがあります。

Failed to load https://hoge.auth0.com/user/ssodata: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access. The response had HTTP status code 404.

Auth0の設定でクロスオリジンを設定してもエラーが出ていたので不思議だなと思っていたのですが、こんな記述がありました。

Embedded login for web uses Cross Origin Authentication, which does not work reliably on all browsers if you do not enable Custom Domains. The use of Custom Domains is a paid feature. A good alternative is to migrate to Universal Login if you cannot use Custom Domains in your application.

このエラーはLock Widgetというサイト埋め込み型のログイン(embedded login)を利用した時に発生するのですが、どうやらembedded loginの場合は有料のカスタムドメインを利用しないとクロスドメインアクセスが出来ないようです。

カスタムドメインが使えない人は大人しくUniversal Loginを使うようにしましょう。

13
3
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
3