See https://developer.github.com/v3/oauth/.
popcorn :: GithubLogin :: allow_signup=
Allow signup at login.popcorn :: GithubLogin :: build_auth_redirect
Build Github URL to OAuth service.popcorn :: GithubLogin :: client_id
Client ID delivered by GitHub for your application.popcorn :: GithubLogin :: client_id=
Client ID delivered by GitHub for your application.popcorn :: GithubLogin :: defaultinit
popcorn :: GithubLogin :: redirect_uri
The URL in your application where users will be sent after authorization.popcorn :: GithubLogin :: redirect_uri=
The URL in your application where users will be sent after authorization.popcorn :: GithubLogin :: scope=
A space delimited list of scopes.popcorn :: GithubLogin :: state
An optional and unguessable random string.popcorn :: GithubLogin :: state=
An optional and unguessable random string.popcorn $ GithubLogin :: SELF
Type of this instance, automatically specialized in every classpopcorn :: GithubLogin :: allow_signup=
Allow signup at login.popcorn :: GithubLogin :: build_auth_redirect
Build Github URL to OAuth service.core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
popcorn :: GithubLogin :: client_id
Client ID delivered by GitHub for your application.popcorn :: GithubLogin :: client_id=
Client ID delivered by GitHub for your application.popcorn :: GithubLogin :: defaultinit
popcorn :: Handler :: defaultinit
core :: Object :: defaultinit
popcorn :: Handler :: deserialize_body
Deserialize the request bodycore :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).popcorn :: GithubLogin :: redirect_uri
The URL in your application where users will be sent after authorization.popcorn :: GithubLogin :: redirect_uri=
The URL in your application where users will be sent after authorization.popcorn :: GithubLogin :: scope=
A space delimited list of scopes.popcorn :: GithubLogin :: state
An optional and unguessable random string.popcorn :: GithubLogin :: state=
An optional and unguessable random string.popcorn :: Handler :: validate_body
Validate body input withvalidator
popcorn :: Handler :: validator
Validator used to check body inputpopcorn :: Handler :: validator=
Validator used to check body input
# Github OAuth login handler.
#
# See https://developer.github.com/v3/oauth/.
class GithubLogin
super Handler
# Client ID delivered by GitHub for your application.
#
# See https://github.com/settings/applications/new.
var client_id: String is writable
# The URL in your application where users will be sent after authorization.
#
# If `null`, the URL used in application registration will be used.
#
# See https://developer.github.com/v3/oauth/#redirect-urls.
var redirect_uri: nullable String = null is writable
# A space delimited list of scopes.
#
# See https://developer.github.com/v3/oauth/#scopes.
var scope: nullable String = null is writable
# An optional and unguessable random string.
#
# It is used to protect against cross-site request forgery attacks.
var state: nullable String = null is writable
# Allow signup at login.
#
# Whether or not unauthenticated users will be offered an option to sign up
# for GitHub during the OAuth flow. The default is true.
#
# Use false in the case that a policy prohibits signups.
var allow_signup = true is writable
# Github OAuth login URL.
var auth_url = "https://github.com/login/oauth/authorize" is writable
# Build Github URL to OAuth service.
fun build_auth_redirect: String do
var url = "{auth_url}?client_id={client_id}&allow_signup={allow_signup}"
var redirect_uri = self.redirect_uri
if redirect_uri != null then url = "{url}&redirect_uri={redirect_uri}"
var scope = self.scope
if scope != null then url = "{url}&scope={scope}"
var state = self.state
if state != null then url = "{url}&state={state}"
return url
end
redef fun get(req, res) do res.redirect build_auth_redirect
end
lib/popcorn/pop_auth.nit:84,1--136,3