Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve data to mount my own the activation and/or password recovery link #1668

Closed
lucassimon opened this issue Aug 20, 2021 · 2 comments
Closed
Labels
stale Feedback from one or more authors is required to proceed.
Milestone

Comments

@lucassimon
Copy link

Is your feature request related to a problem? Please describe.

I would like to have the data to mount the activation and/or password recovery link. With this data I could submit an event to another API or a queuing system that will process the event and be able to send the email through other email services, such as sendgrid, mailchimp and others....

Describe the solution you'd like

Contexts:

Create identity

Fetch register flow

Request

curl -X GET 0.0.0.0:4433/self-service/registration/api -H 'Accept: application/json' | jq

Response

{
  "id": "6e0c9b4a-3d94-428e-ba36-2f7fa3810e68",
  "type": "api",
  "expires_at": "2021-08-20T15:05:09.06896773Z",
  "issued_at": "2021-08-20T14:55:09.06896773Z",
  "request_url": "http://0.0.0.0:4433/self-service/registration/api",
  "ui": {
    "action": "http://local.lab.com/user-svc/public/self-service/registration?flow=6e0c9b4a-3d94-428e-ba36-2f7fa3810e68",
    "method": "POST",
    "nodes": [
      {
        "type": "input",
        "group": "default",
        "attributes": {
          "name": "csrf_token",
          "type": "hidden",
          "value": "",
          "required": true,
          "disabled": false
        },
        "messages": [],
        "meta": {}
      },
      {
        "type": "input",
        "group": "password",
        "attributes": {
          "name": "traits.email",
          "type": "email",
          "disabled": false
        },
        "messages": [],
        "meta": {
          "label": {
            "id": 1070002,
            "text": "E-Mail",
            "type": "info"
          }
        }
      },
      {
        "type": "input",
        "group": "password",
        "attributes": {
          "name": "password",
          "type": "password",
          "required": true,
          "disabled": false
        },
        "messages": [],
        "meta": {
          "label": {
            "id": 1070001,
            "text": "Password",
            "type": "info"
          }
        }
      },
      {
        "type": "input",
        "group": "password",
        "attributes": {
          "name": "method",
          "type": "submit",
          "value": "password",
          "disabled": false
        },
        "messages": [],
        "meta": {
          "label": {
            "id": 1040001,
            "text": "Sign up",
            "type": "info",
            "context": {}
          }
        }
      }
    ]
  }
}

Submit register flow

Request

curl -X POST "http://0.0.0.0:4433/self-service/registration?flow=6e0c9b4a-3d94-428e-ba36-2f7fa3810e68" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"traits":{"email": "foo@bar.com"}, "method": "password", "password":"foo_bar_123"}' | jq

Response

{
  "session_token": "vJI1C7Xq1Szp0hl7OJmjVtPlnkw7mfjw",
  "session": {
    "id": "0c981101-a38c-4b8e-ba8c-bd64f53475ee",
    "active": true,
    "expires_at": "2021-08-21T14:58:57.576680924Z",
    "authenticated_at": "2021-08-20T14:58:57.594350035Z",
    "issued_at": "2021-08-20T14:58:57.576687376Z",
    "identity": {
      "id": "52f1ae29-7d80-475d-9dc5-172fdcb62eb5",
      "schema_id": "default",
      "schema_url": "http://local.lab.com/user-svc/public/schemas/default",
      "state": "active",
      "state_changed_at": "2021-08-20T14:58:57.560358941Z",
      "traits": {
        "email": "foo@bar.com"
      },
      "verifiable_addresses": [
        {
          "id": "53679473-4f0d-4c6d-8a96-1f78f9a6114d",
          "value": "foo@bar.com",
          "verified": false,
          "via": "email",
          "status": "sent",
          "verified_at": null,
          "created_at": "2021-08-20T14:58:57.564945Z",
          "updated_at": "2021-08-20T14:58:57.564945Z"
        }
      ],
      "recovery_addresses": [
        {
          "id": "3b21a280-38f0-45ce-80eb-a582f0cd66a8",
          "value": "foo@bar.com",
          "via": "email",
          "created_at": "2021-08-20T14:58:57.568329Z",
          "updated_at": "2021-08-20T14:58:57.568329Z"
        }
      ],
      "created_at": "2021-08-20T14:58:57.561832Z",
      "updated_at": "2021-08-20T14:58:57.561832Z"
    }
  },
  "identity": {
    "id": "52f1ae29-7d80-475d-9dc5-172fdcb62eb5",
    "schema_id": "default",
    "schema_url": "http://local.lab.com/user-svc/public/schemas/default",
    "state": "active",
    "state_changed_at": "2021-08-20T14:58:57.560358941Z",
    "traits": {
      "email": "foo@bar.com"
    },
    "verifiable_addresses": [
      {
        "id": "53679473-4f0d-4c6d-8a96-1f78f9a6114d",
        "value": "foo@bar.com",
        "verified": false,
        "via": "email",
        "status": "sent",
        "verified_at": null,
        "created_at": "2021-08-20T14:58:57.564945Z",
        "updated_at": "2021-08-20T14:58:57.564945Z"
      }
    ],
    "recovery_addresses": [
      {
        "id": "3b21a280-38f0-45ce-80eb-a582f0cd66a8",
        "value": "foo@bar.com",
        "via": "email",
        "created_at": "2021-08-20T14:58:57.568329Z",
        "updated_at": "2021-08-20T14:58:57.568329Z"
      }
    ],
    "created_at": "2021-08-20T14:58:57.561832Z",
    "updated_at": "2021-08-20T14:58:57.561832Z"
  }
}

Activate account

Fetch verification flow

Request

curl -X GET 0.0.0.0:4433/self-service/verification/api -H 'Accept: application/json' | jq

Response

{
  "id": "8f2ee88f-3d7b-4728-b14e-493fbad79e97",
  "type": "api",
  "expires_at": "2021-08-20T15:51:57.044453881Z",
  "issued_at": "2021-08-20T14:51:57.044453881Z",
  "request_url": "http://0.0.0.0:4433/self-service/verification/api",
  "ui": {
    "action": "http://local.lab.com/user-svc/public/self-service/verification?flow=8f2ee88f-3d7b-4728-b14e-493fbad79e97",
    "method": "POST",
    "nodes": [
      {
        "type": "input",
        "group": "default",
        "attributes": {
          "name": "csrf_token",
          "type": "hidden",
          "value": "",
          "required": true,
          "disabled": false
        },
        "messages": [],
        "meta": {}
      },
      {
        "type": "input",
        "group": "link",
        "attributes": {
          "name": "email",
          "type": "email",
          "required": true,
          "disabled": false
        },
        "messages": [],
        "meta": {}
      },
      {
        "type": "input",
        "group": "link",
        "attributes": {
          "name": "method",
          "type": "submit",
          "value": "link",
          "disabled": false
        },
        "messages": [],
        "meta": {
          "label": {
            "id": 1070005,
            "text": "Submit",
            "type": "info"
          }
        }
      }
    ]
  },
  "state": "choose_method"
}

Submit verification flow

Request

curl -X POST "http://0.0.0.0:4433/self-service/verification?flow=8f2ee88f-3d7b-4728-b14e-493fbad79e97" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"email": "foo@bar.com", "method": "link"}' | jq

Response

{
  "id": "8f2ee88f-3d7b-4728-b14e-493fbad79e97",
  "type": "api",
  "expires_at": "2021-08-20T15:51:57.044453Z",
  "issued_at": "2021-08-20T14:51:57.044453Z",
  "request_url": "http://0.0.0.0:4433/self-service/verification/api",
  "active": "link",
  "ui": {
    "action": "http://local.lab.com/user-svc/public/self-service/verification?flow=8f2ee88f-3d7b-4728-b14e-493fbad79e97",
    "method": "POST",
    "nodes": [
      {
        "type": "input",
        "group": "default",
        "attributes": {
          "name": "csrf_token",
          "type": "hidden",
          "value": "",
          "required": true,
          "disabled": false
        },
        "messages": [],
        "meta": {}
      },
      {
        "type": "input",
        "group": "link",
        "attributes": {
          "name": "email",
          "type": "email",
          "value": "foo@bar.com",
          "required": true,
          "disabled": false
        },
        "messages": [],
        "meta": {}
      },
      {
        "type": "input",
        "group": "link",
        "attributes": {
          "name": "method",
          "type": "submit",
          "value": "link",
          "disabled": false
        },
        "messages": [],
        "meta": {
          "label": {
            "id": 1070005,
            "text": "Submit",
            "type": "info"
          }
        }
      }
    ],
    "messages": [
      {
        "id": 1070001,
        "text": "An email containing a verification link has been sent to the email address you provided.",
        "type": "info",
        "context": {}
      }
    ]
  },
  "state": "sent_email"
}

A clear and concise description of what you want to happen.

When submitting in the method field the value of only_data in the request.

curl -X POST "http://0.0.0.0:4433/self-service/verification?flow=8f2ee88f-3d7b-4728-b14e-493fbad79e97" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"email": "foo@bar.com", "method": "only_data"}' | jq

The answer should give me all the fields I need to create my own verification link, including the tokens.

Example:

.....
   "messages": [
      {
        "id": "number + atoi,
        "text": "token generated",
        "type": "info",
        "context": {
           "token": "12312-3456-4484-7891505159-451223123"
        }
      }
    ]
  },
  "state": "token_generated"
}

Describe alternatives you've considered

Another option would be to be able to define this setting in the file kratos.json, where according to the settings, it returns the data to generate the link

  flows:
    verification:
      enabled: true
      ui_url: ${GATEWAY_SVC_URL}/auth/verify
      sent_mail: false
      returns_only_data: true
@aeneasr
Copy link
Member

aeneasr commented Aug 21, 2021

I think this is a dupe of #1030

@github-actions
Copy link

github-actions bot commented Jun 3, 2023

Hello contributors!

I am marking this issue as stale as it has not received any engagement from the community or maintainers for a year. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas on how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan for resolving the issue.

Throughout its lifetime, Ory has received over 10.000 issues and PRs. To sustain that growth, we need to prioritize and focus on issues that are important to the community. A good indication of importance, and thus priority, is activity on a topic.

Unfortunately, burnout has become a topic of concern amongst open-source projects.

It can lead to severe personal and health issues as well as opening catastrophic attack vectors.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone.

If this issue was marked as stale erroneously you can exempt it by adding the backlog label, assigning someone, or setting a milestone for it.

Thank you for your understanding and to anyone who participated in the conversation! And as written above, please do participate in the conversation if this topic is important to you!

Thank you 🙏✌️

@github-actions github-actions bot added the stale Feedback from one or more authors is required to proceed. label Jun 3, 2023
@github-actions github-actions bot closed this as completed Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Feedback from one or more authors is required to proceed.
Projects
None yet
Development

No branches or pull requests

2 participants