Class: MediaWiktory::Wikipedia::Actions::Clientlogin
- Defined in:
- lib/mediawiktory/wikipedia/actions/clientlogin.rb
Overview
Log in to the wiki using the interactive flow.
Usage:
api.clientlogin.requests(value).perform # returns string with raw output
# or
api.clientlogin.requests(value).response # returns output parsed and wrapped into Response object
See Base for generic explanation of working with MediaWiki actions and Response for working with action responses.
All action's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#continue ⇒ self
This request is a continuation after an earlier UI or REDIRECT response.
-
#mergerequestfields ⇒ self
Merge field information for all authentication requests into one array.
-
#messageformat(value) ⇒ self
Format to use for returning messages.
-
#preservestate ⇒ self
Preserve state from a previous failed login attempt, if possible.
-
#requests(*values) ⇒ self
Only use these authentication requests, by the id returned from action=query&meta=authmanagerinfo with amirequestsfor=login or from a previous response from this module.
-
#returnurl(value) ⇒ self
Return URL for third-party authentication flows, must be absolute.
-
#token(value) ⇒ self
A "login" token retrieved from action=query&meta=tokens.
Methods inherited from Post
Methods inherited from Base
#inspect, #merge, #name, #perform, #response, #to_h, #to_param, #to_url
Methods included from GlobalParams
#assert, #assertuser, #centralauthtoken, #curtimestamp, #errorformat, #errorlang, #errorsuselocal, #format, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang
Instance Method Details
#continue ⇒ self
This request is a continuation after an earlier UI or REDIRECT response. Either this or loginreturnurl is required.
73 74 75 |
# File 'lib/mediawiktory/wikipedia/actions/clientlogin.rb', line 73 def continue() merge(logincontinue: 'true') end |
#mergerequestfields ⇒ self
Merge field information for all authentication requests into one array.
51 52 53 |
# File 'lib/mediawiktory/wikipedia/actions/clientlogin.rb', line 51 def mergerequestfields() merge(loginmergerequestfields: 'true') end |
#messageformat(value) ⇒ self
Format to use for returning messages.
39 40 41 |
# File 'lib/mediawiktory/wikipedia/actions/clientlogin.rb', line 39 def (value) (value) or fail ArgumentError, "Unknown value for messageformat: #{value}" end |
#preservestate ⇒ self
Preserve state from a previous failed login attempt, if possible.
58 59 60 |
# File 'lib/mediawiktory/wikipedia/actions/clientlogin.rb', line 58 def preservestate() merge(loginpreservestate: 'true') end |
#requests(*values) ⇒ self
Only use these authentication requests, by the id returned from action=query&meta=authmanagerinfo with amirequestsfor=login or from a previous response from this module.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/clientlogin.rb', line 26 def requests(*values) values.inject(self) { |res, val| res._requests(val) } end |
#returnurl(value) ⇒ self
Return URL for third-party authentication flows, must be absolute. Either this or logincontinue is required.
66 67 68 |
# File 'lib/mediawiktory/wikipedia/actions/clientlogin.rb', line 66 def returnurl(value) merge(loginreturnurl: value.to_s) end |
#token(value) ⇒ self
A "login" token retrieved from action=query&meta=tokens
81 82 83 |
# File 'lib/mediawiktory/wikipedia/actions/clientlogin.rb', line 81 def token(value) merge(logintoken: value.to_s) end |