LoginSignup
1
0

More than 3 years have passed since last update.

【Auth0】認証時に任意のパラメータをRuleに渡す。

Posted at

認証時に色々やりたい時に、フロントからこのパラメータをRuleに受け渡したい!というケース、ありそうです。

今回はフロント側auth0-spa-js,loginWithRedirectでログインするとして、Auth0のUniversalLoginを利用します。

やり方

      this.$auth.loginWithRedirect({
        hoge: 'nyaaa'
      });

と書けば Ruleのcontext.request.queryには

{
  "protocol": "oauth2",
  "client_id": "xxx",
  "redirect_uri": "http://localhost:3000",
  "hoge": "nyaaa",
  "scope": "openid profile email",
  "response_type": "code",
  "response_mode": "query",
  "state": "TnM2UTRhR2ZvanBna28zSklZSjdxNFlfRGpoMDMtY3FKdX5TVUl6ZXduQg==",
  "nonce": "vhGKxvRCUezZ6eLlpO-.fD17O0xXZd5JJoFr~37~S9Q",
  "code_challenge": "",
  "code_challenge_method": "S256",
  "auth0Client": "eyJuYW1lIjoiYXV0aDAtc3BhLWpzIiwidmVyc2lvbiI6IjEuMi4zIn0=",
  "connection": "Username-Password-Authentication",
  "realm": "Username-Password-Authentication"
}

hoge:"nyaaa"のKey Valueが追加される!

1
0
0

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
1
0