hey All, I am trying to implement oauth with the p...
# talk-kratos
c
hey All, I am trying to implement oauth with the proxy but I’m getting redirected to the cloud endpoint: https://tca0.nl/IZm How do I set the redirect URL to the same endpoint as where I attempted the sign-in from ?
h
thank you for the question, could you please share a few more details on your set up in a github discussion? 🙂 github.com/ory/cloud/discussions
c
h
👍
c
@high-optician-2097 Can we solve this by upgrading our subscription or self hosting? We cannot launch without social sign-in
h
OIDC works, it just doesn’t work easily on the local system 🙂
c
Won’t we have the same issue on production?
h
no!
c
how so ?
h
but you shuold set up a custom domain for production, we’ll also clarify that in the product soon
if you use the code FIRST900 it’s free for the next half year also 🙂
c
We have 5 different subdomains that users sign-in from
h
that’s fine, it will work, as long as everything is under one top level domain and as long as you have set up custom domains
c
So how do I test it locally?
h
in the chrome console, you’ll see a network request going to
<http://oryapis.com/self-service/.../callback?code=|oryapis.com/self-service/.../callback?code=>...
. copy that URL and change oryapis to the URL where the proxy is running. it’s a bit tedious, but should do the trick. I just created an issue to track this problem here: https://github.com/ory/cloud/issues/113 Sorry for the inconvenience on this. Unfortunately, social sign in is highly regulated in terms of security checks so it’s a bit painful to set up correctly without issues. But we have it on the list of things to fix :)
c
Allright, thanks so far.
Another question: how do I add a username field to the signin / signup? I added it to the schema but it doesn’t appear in the UI
Copy code
identity:
  default_schema_id: <preset://email>
  schemas:
  - id: <preset://email>
    url: base64://
added to traits / properties:
Copy code
"username": {
           "type": "string",
           "title": "Username/Nickname",
           "minLength": 2,
           "maxLength": 24,
        },
h
try reloading the flow 🙂
so creating a new flow I mean, the old flow will contain the old data
c
Still not there
Copy code
{
  "$id": "<https://schemas.ory.sh/presets/kratos/identity.email.schema.json>",
  "$schema": "<http://json-schema.org/draft-07/schema#>",
  "title": "Person",
  "type": "object",
  "properties": {
    "traits": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "title": "E-Mail",
          "<http://ory.sh/kratos|ory.sh/kratos>": {
            "credentials": {
              "password": {
                "identifier": true
              },
              "webauthn": {
                "identifier": true
              },
              "totp": {
                "account_name": true
              }
            },
            "recovery": {
              "via": "email"
            },
            "verification": {
              "via": "email"
            }
          },
          "maxLength": 320
        },
        "username": {
           "type": "string",
           "title": "Username/nickname",
           "minLength": 2,
           "maxLength": 24
        },
      },
      "required": [
        "email",
        "username"
      ],
      "additionalProperties": false
    }
  }
}
this is the full schema
@high-optician-2097 I’d greatly appreciate any help on this
h
sorry I'm busy right now maybe someone else can help
c
Sure, no problem.
Weirdly enough it works after I updated the schema via the UI which makes it a JSON file hosted on GCS instead of a base64 encoded string
h
ok, great to hear that it works! the b64 encoding import should work, could you share the command you used to import it?
c
yes I updated it with:
Copy code
ory update identity-config <project id> --file config/auth/identity-config.yaml
Only difference is the same schema is now:
Copy code
url: <https://storage.googleapis.com/bac-gcs-production/f123d78f790e52d69676ade0eed6e6d729363bb765a37ae2c4ddf5ddf1914740b0dc0d883cc661975402a9ff8f7134083c0193cc7d43f66323124f68331760b1.json>
instead of
Copy code
url: <base64://eyIkaWQiOiJodHRwczovL3NjaGVtYXMub3J5LnNoL3ByZXNldHMva3JhdG9zL2l>kZW50aXR5LmVtYWlsLnNjaGVtYS5qc29uIiwidGl0bGUiOiJQZXJzb24iLCJ0eXBlIjoib2JqZWN0IiwicHJvcGVydGllcyI6eyJ0cmFpdHMiOnsidHlwZSI6Im9iamVjdCIsInByb3BlcnRpZXMiOnsiZW1haWwiOnsidHlwZSI6InN0cmluZyIsImZvcm1hdCI6ImVtYWlsIiwidGl0bGUiOiJFLU1haWwiLCJvcnkuc2gva3JhdG9zIjp7ImNyZWRlbnRpYWxzIjp7InBhc3N3b3JkIjp7ImlkZW50aWZpZXIiOnRydWV9LCJ3ZWJhdXRobiI6eyJpZGVudGlmaWVyIjp0cnVlfSwidG90cCI6eyJhY2NvdW50X25hbWUiOnRydWV9fSwicmVjb3ZlcnkiOnsidmlhIjoiZW1haWwifSwidmVyaWZpY2F0aW9uIjp7InZpYSI6ImVtYWlsIn19LCJtYXhMZW5ndGgiOjMyMH0sInVzZXJuYW1lIjp7InR5cGUiOiJzdHJpbmciLCJ0aXRsZSI6IlVzZXJuYW1lL25pY2tuYW1lIiwibWluTGVuZ3RoIjoyLCJtYXhMZW5ndGgiOjI0fX0sInJlcXVpcmVkIjpbImVtYWlsIiwidXNlcm5hbWUiXSwiYWRkaXRpb25hbFByb3BlcnRpZXMiOmZhbHNlfX0sIiRzY2hlbWEiOiJodHRwOi8vanNvbi1zY2hlbWEub3JnL2RyYWZ0LTA3L3NjaGVtYSMifQ==
As far as I know, not sure what else the Cloud UI did