{"id":19385779,"url":"https://github.com/skoda091/cognitex","last_synced_at":"2025-04-23T22:32:04.132Z","repository":{"id":32857409,"uuid":"144154673","full_name":"Skoda091/cognitex","owner":"Skoda091","description":"Library for managing user accounts through AWS Cognito service.","archived":false,"fork":false,"pushed_at":"2022-02-08T13:45:13.000Z","size":16,"stargazers_count":32,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T21:42:31.830Z","etag":null,"topics":["api-wrapper","aws","cognito","elixir"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Skoda091.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-09T13:14:03.000Z","updated_at":"2024-11-28T16:34:02.000Z","dependencies_parsed_at":"2022-08-07T18:15:39.394Z","dependency_job_id":null,"html_url":"https://github.com/Skoda091/cognitex","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skoda091%2Fcognitex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skoda091%2Fcognitex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skoda091%2Fcognitex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skoda091%2Fcognitex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Skoda091","download_url":"https://codeload.github.com/Skoda091/cognitex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250527139,"owners_count":21445311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","aws","cognito","elixir"],"created_at":"2024-11-10T10:03:03.518Z","updated_at":"2025-04-23T22:32:03.866Z","avatar_url":"https://github.com/Skoda091.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cognitex\n[![Build Status](https://travis-ci.org/Skoda091/cognitex.svg?branch=master)](https://travis-ci.org/Skoda091/cognitex)\n[![hex.pm version](https://img.shields.io/badge/hex-v0.1.0-blue.svg)](https://hex.pm/packages/cognitex)\n\nA simple library to handle user management over [AWS Cognito service](https://aws.amazon.com/cognito/).\n\nThe following functionality is covered;\n\n* User registration\n* Confirm registration (with the confirmation code received from AWS, by email)\n* User authentication\n* Fetch user data by an access token\n* Fetch user data by username\n* Change user password\n* Update user attributes\n* Reset a forgotten password\n\nOnline documentation is available [here](https://hexdocs.pm/cognitex/0.1.0/api-reference.html).\n\n## Installation\n\nTo use `cognitex` with your projects, edit your `mix.exs` file to add it as a dependency:\n\n```elixir\ndef deps do\n  [\n    {:cognitex, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Configuration\n\nAn example config might look like this:\n\n```elixir\nconfig :aws,\n  key: \"\u003cAWS_ACCESS_KEY_ID\u003e\",\n  secret: \"\u003cAWS_SECRET_ACCESS_KEY\u003e\",\n  region: \"\u003cAWS_REGION\u003e\",\n  client_id: \"\u003cAWS_CLIENT_ID\u003e\",\n  user_pool_id: \"\u003cAWS_USER_POOL_ID\u003e\"\n```\n\n## Set up AWS Cognito with the correct configuration\nFirst, we will set up a new AWS Cognito user pool with the correct configuration.\n\n1. Visit your AWS console and go to the AWS Cognito service. Click on \"Manage your User Pools\" and click \"Create a User Pool\".\n2. Specify a name for your pool and click \"Review Defaults\".\n3. Optional: edit the password policy to remove some of the requirements. If you are just testing, using simple passwords will make it easier.\n4. Click the \"edit client\" link. Specify a name for your app and be sure to *disable* the client secret and *enable* the `ADMIN_NO_SRP_AUTH` option.\n5. Click \"Create pool\". Take note of the *Pool Id* at the top of the page and click on the apps page. Here, take note of the *App client id*.\n\n## Usage\n\n```elixir\niex\u003e Cognitex.sign_up(\"john.smith@example.com\", \"Test123\", name: \"John\", family_name: \"Smith\")\n{:ok,\n  %{\n    \"CodeDeliveryDetails\" =\u003e %{\n      \"AttributeName\" =\u003e \"email\",\n      \"DeliveryMedium\" =\u003e \"EMAIL\",\n      \"Destination\" =\u003e \"j***@e***.co\"\n    },\n    \"UserConfirmed\" =\u003e false,\n    \"UserSub\" =\u003e \"uuid\"\n  }\n}\n\niex\u003e Cognitex.sign_up(\"john.smith@example.com\", \"Test123\", name: \"John\", family_name: \"Smith\")\n{:error,\n  %{\n    message: \"An account with the given email already exists.\",\n    status: \"UsernameExistsException\"\n  }\n}\n```\n\nFull documentation is available [here](https://hexdocs.pm/cognitex/0.1.0/api-reference.html).\n\n### References\n\n* Official Cognito [API reference](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/Welcome.html):\n\n### Licensing, thanks\n\nThis library is released under the [MIT License](https://opensource.org/licenses/MIT).\n\nIt is based on:\n* [cognito-phx](https://gitlab.com/azohra/cognito-phx/)\n* [aws-elixir](https://github.com/aws-beam/aws-elixir)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskoda091%2Fcognitex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskoda091%2Fcognitex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskoda091%2Fcognitex/lists"}