{"id":16241810,"url":"https://github.com/5ht/avz","last_synced_at":"2025-07-05T00:35:03.672Z","repository":{"id":10214311,"uuid":"12310592","full_name":"5HT/avz","owner":"5HT","description":"🔑 AVZ: Social Authorization","archived":false,"fork":false,"pushed_at":"2021-11-08T10:37:42.000Z","size":141,"stargazers_count":41,"open_issues_count":0,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-17T09:21:17.857Z","etag":null,"topics":["facebook","github","google","microsoft"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/5HT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-22T23:55:53.000Z","updated_at":"2024-12-11T22:10:57.000Z","dependencies_parsed_at":"2022-08-28T08:40:08.220Z","dependency_job_id":null,"html_url":"https://github.com/5HT/avz","commit_stats":null,"previous_names":["5ht/avz","synrc/avz"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT%2Favz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT%2Favz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT%2Favz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT%2Favz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5HT","download_url":"https://codeload.github.com/5HT/avz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244473634,"owners_count":20458495,"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":["facebook","github","google","microsoft"],"created_at":"2024-10-10T14:08:41.193Z","updated_at":"2025-03-19T17:30:43.341Z","avatar_url":"https://github.com/5HT.png","language":"Erlang","readme":"AVZ Login System for N2O\n========================\n\nAuthentication methods for N2O sites. Supports both JavaScript based\nlogins (like Google and Facebook) and redirect based OAuth logins (Twitter, Github)\nin a sane and simple manner. Compatible with but not limited to Nitrogen and N2O.\n\nSupported Methods\n-----------------\n\n* Twitter\n* Google\n* Facebook\n* Github\n* Microsoft\n* Telegram\n\nAPI\n---\n\n    sdk/0                % JavaScript for page embedding for JavaScript based login methods\n    login_button/0       % HTML Button for page embedding\n    event/1              % Page Event for HTTP redirect based login methods\n    api_event/3          % Page Event for JavaScript based login methods\n    callback/0           % Callback part of HTTP redirect based login methods\n    registration_data/3  % Process Parameters\n\nUsage\n-----\n\nPretty short example is given at http://maxim.livejournal.com/421845.html (Russain) along\nwith discussion how to design pages with N2O. Example of Login also could be found in [http://github.com/5HT/skyline](http://github.com/5HT/skyline) project.\n\nStyles\n------\n\nLibrary provide only basic HTML markup for the buttons where its not strictly regulated by provider design guidelines.\nHowever its easy to provide custom CSS class and/or support any CSS framework on your login page with N2O `#jq{}` action.\n\nExample of styling FB login button with Bootstrap:\n\n```erlang\nevent(init) -\u003e \n  wf:wire(#jq{target=loginfb, method=[\"classList.add\"], args=[\"'btn', 'btn-primary', 'btn-lg'\"]}),\n  ...\n```\n\nExample of styling Github button with Pure.css\n\n```erlang\nevent(init) -\u003e\n  wf:wire(#jq{target=github_btn, method=[\"classList.add\"], args=[\"'pure-button'\"]})\n  ...\n```\n\nConfiguration\n-------------\n\nAuthentication endpoints can be configured in your `sys.config` under avz application settings.\n\nAvailable settings listed below with test applications configured for each provider and will\ncall you back on `http://localhost:8000/login`.\n\n\n```erlang\n{\n  ...\n  {avz, [ % General\n        {after_login_page, \"/index\"},\n        {login_page, \"/login\"},\n        {json,jsone},\n\n        % Facebook Login\n        {fb_id, \"176025532423202\"},\n\n        % Twitter OAuth\n        {tw_consumer_key, \"YwfU5qj5AYY0uwPumcw1Q\"},\n        {tw_consumer_secret, \"O7VjRYLWxwMgtSXZbiiY6kc1Og2il9gbo1KAIqZk\"},\n\n        % Google Sign-In\n        {g_client_id, \"158344909038-j6c0rbvpi09kdaqq03j2eddlf047ht3d.apps.googleusercontent.com\"}, \n        {g_cookiepolicy, \"http://localhost:8000\"},\n        \n        % Google Sign-In button settings\n        {g_btn_width, 240},\n        {g_btn_height, 50},\n        {g_btn_theme, \"light\"},\n        {g_btn_longtitle, true},\n\n        % Github OAuth\n        {github_client_id, \"591bfe2556ee60ca8c32\"},\n        {github_client_secret, \"01411884e3c51624d3ea729ed6b047db52973e8e\"},\n\n        % Microsoft Account Login\n        {ms_client_id, \"54385d15-f1e0-4fcf-9bf4-042d740e0df4\"},\n        {ms_client_secret, \"jU0tStEzRdDPFwL9NdVGYxo\"},\n        {ms_redirect_uri, \"http://localhost:8000/login\"},\n        \n        % Telegram Login Widget\n        {tl_bot, \"NYNJA_bot\"},\n        {tl_bot_token, \"548231922:AAHmXMMr38XGtH0tJMDUdiByheT2mZ7qkVI\"}\n        {tl_auth_url, \"http://127.0.0.1/login\"},\n        {tl_request_access, \"write\"}\n        {tl_btn_size, \"large\"},\n        {tl_btn_radius, \"20\"},\n  ]}\n  ...\n}\n```\n\nTelegram Notes\n---------------\nLogin widget is displayed within the iframe, so the battle of `CPS` and `x-frame-options` is expected in different browsers.\n\nWhen setting a domain in BotFather with `/setdomain`, please note that telegram will cut the port part of your domain in the `X-Frame-Options` and `Content-Security-Policy` response headers. \n\nSo in fact you are limited to use 80 and 443 ports only.\n\nCredits\n-------\n\n* Andrii Zadorozhnii\n* Andrii Sergiienko\n* Maxim Sokhatsky\n\nOM A HUM\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5ht%2Favz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5ht%2Favz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5ht%2Favz/lists"}