{"id":28614189,"url":"https://github.com/perldancer/dancer-plugin-auth-twitter","last_synced_at":"2025-06-12T01:13:26.776Z","repository":{"id":1183259,"uuid":"1083578","full_name":"PerlDancer/Dancer-Plugin-Auth-Twitter","owner":"PerlDancer","description":"authenticate users with Twitter OAuth","archived":false,"fork":false,"pushed_at":"2018-08-07T19:52:53.000Z","size":107,"stargazers_count":10,"open_issues_count":0,"forks_count":9,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-05-09T11:35:47.083Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PerlDancer.png","metadata":{"files":{"readme":"README","changelog":"Changes","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":"2010-11-15T23:50:43.000Z","updated_at":"2021-08-22T03:22:48.000Z","dependencies_parsed_at":"2022-08-16T12:30:22.321Z","dependency_job_id":null,"html_url":"https://github.com/PerlDancer/Dancer-Plugin-Auth-Twitter","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/PerlDancer/Dancer-Plugin-Auth-Twitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerlDancer%2FDancer-Plugin-Auth-Twitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerlDancer%2FDancer-Plugin-Auth-Twitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerlDancer%2FDancer-Plugin-Auth-Twitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerlDancer%2FDancer-Plugin-Auth-Twitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PerlDancer","download_url":"https://codeload.github.com/PerlDancer/Dancer-Plugin-Auth-Twitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerlDancer%2FDancer-Plugin-Auth-Twitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259374995,"owners_count":22847878,"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":[],"created_at":"2025-06-12T01:13:23.100Z","updated_at":"2025-06-12T01:13:26.756Z","avatar_url":"https://github.com/PerlDancer.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n    Dancer::Plugin::Auth::Twitter - Authenticate with Twitter\n\nVERSION\n    version 0.07\n\nSYNOPSIS\n        package SomeDancerApp;\n        use Dancer ':syntax';\n        use Dancer::Plugin::Auth::Twitter;\n\n        auth_twitter_init();\n\n        before sub {\n            if (not session('twitter_user')) {\n                redirect auth_twitter_authenticate_url;\n            }\n        };\n\n        get '/' =\u003e sub {\n            \"welcome, \".session('twitter_user')-\u003e{'screen_name'};\n        };\n\n        get '/fail' =\u003e sub { \"FAIL\" };\n\n        ...\n\nCONCEPT\n    This plugin provides a simple way to authenticate your users through\n    Twitter's OAuth API. It provides you with a helper to build easily a\n    redirect to the authentication URI, defines automatically a callback\n    route handler and saves the authenticated user to your session when\n    done.\n\nPREREQUESITES\n    In order for this plugin to work, you need the following:\n\n    *   Twitter application\n\n        Anyone can register a Twitter application at\n        \u003chttp://dev.twitter.com/\u003e. When done, make sure to configure the\n        application as a *Web* application.\n\n    *   Configuration\n\n        You need to configure the plugin first: copy your \"consumer_key\" and\n        \"consumer_secret\" (provided by Twitter) to your Dancer's\n        configuration under \"plugins/Auth::Twitter\":\n\n            # config.yml\n            ...\n            plugins:\n              \"Auth::Twitter\":\n                consumer_key:     \"1234\"\n                consumer_secret:  \"abcd\"\n                callback_url:     \"http://localhost:3000/auth/twitter/callback\"\n                callback_success: \"/\"\n                callback_fail:    \"/fail\"\n                engine:           Net::Twitter::Lite::WithAPIv1_1\n\n        \"callback_success\" and \"callback_fail\" are optional and default to\n        '/' and '/fail', respectively.\n\n        The engine is optional as well. The supported engines are\n        \"Net::Twitter\" and \"Net::Twitter::Lite::WithAPIv1_1\"\n        (\"Net::Twitter::Lite\" can also be used as a synonym for the latter).\n        By default the plugin will use Net::Twitter::Lite::WithAPIv1_1.\n\n        Note that you also need to provide your callback url, whose route\n        handler is automatically created by the plugin.\n\n    *   Session backend\n\n        For the authentication process to work, you need a session backend,\n        in order for the plugin to store the authenticated user's\n        information.\n\n        Use the session backend of your choice, it doesn't make a\n        difference, see Dancer::Session for details about supported session\n        engines, or search the CPAN for new ones\n        \u003chttp://search.cpan.org/search?query=Dancer-Session\u003e.\n\nEXPORT\n    The plugin exports the following symbols to your application's\n    namespace:\n\n  twitter\n    The plugin uses a Net::Twitter or Net::Twitter::Lite::WithAPIv1_1 object\n    to do its job. You can access this object with the \"twitter\" symbol,\n    exported by the plugin.\n\n  auth_twitter_init\n    This function should be called before your route handlers, in order to\n    initialize the underlying Net::Twitter or\n    Net::Twitter::Lite::WithAPIv1_1 object.\n\n  auth_twitter_authorize_url\n    This function returns an authorize URI for redirecting unauthenticated\n    users. You should use this in a before filter like the following:\n\n        before sub {\n            # we don't want to bounce for ever!\n            return if request-\u003epath =~ m{/auth/twitter/callback};\n    \n            if (not session('twitter_user')) {\n                redirect auth_twitter_authorize_url();\n            }\n        };\n\n    When the user authenticate with Twitter's OAuth interface, she's going\n    to be bounced back to \"/auth/twitter/callback\".\n\n  auth_twitter_authenticate_url\n    Similar to auth_twitter_authorize_url, but this function instead returns\n    an authenticate instead of authorize URI for redirecting unauthenticated\n    users, which results in a slightly different behaviour.\n\n    See \u003chttps://dev.twitter.com/pages/sign_in_with_twitter|here\u003e to learn\n    about the differences.\n\nROUTE HANDLERS\n    The plugin defines the following route handler automatically\n\n  /auth/twitter/callback\n    This route handler is responsible for catching back a user that has just\n    authenticated herself with Twitter's OAuth. The route handler saves\n    tokens and user information in the session and then redirects the user\n    to the URI specified by \"callback_success\".\n\n    If the validation of the token returned by Twitter failed or was denied,\n    the user will be redirect to the URI specified by \"callback_fail\".\n\nTIPS AND TRICKS\n    If you get the error\n\n        Net::Twitter::Role::OAuth::get_authorization_url(): \n            GET https://api.twitter.com/oauth/request_token failed: 500 \n            Can't verify SSL peers without knowing which Certificate Authorities to trust\n\n    you can silence it by setting the environment variable\n    \"PERL_LWP_SSL_VERIFY_HOSTNAME\" to 0.\n\nACKNOWLEDGEMENTS\n    This plugin has been written as a port of\n    Catalyst::Authentication::Credential::Twitter written by Jesse Stay.\n\n    This plugin was part of the Perl Dancer Advent Calendar 2010.\n\nAUTHORS\n    *   Alexis Sukrieh \u003csukria@sukria.net\u003e\n\n    *   Dancer Core Developers\n\nCOPYRIGHT AND LICENSE\n    This software is copyright (c) 2010 by Alexis Sukrieh.\n\n    This is free software; you can redistribute it and/or modify it under\n    the same terms as the Perl 5 programming language system itself.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperldancer%2Fdancer-plugin-auth-twitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperldancer%2Fdancer-plugin-auth-twitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperldancer%2Fdancer-plugin-auth-twitter/lists"}