Class: Onlyfans::Resources::Authenticate
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Authenticate
- Defined in:
- lib/onlyfans/resources/authenticate.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Authenticate
constructor
private
A new instance of Authenticate.
-
#poll_status(attempt_id, request_options: {}) ⇒ Onlyfans::Models::AuthenticatePollStatusResponse
Poll the status of the authentication process.
-
#reauthenticate(account_id, request_options: {}) ⇒ Onlyfans::Models::AuthenticateReauthenticateResponse
Trigger account reauthentication without the need to submit email & password again.
-
#send_2fa_email(attempt_id, request_options: {}) ⇒ Onlyfans::Models::AuthenticateSend2faEmailResponse
Send 2FA verification e-mail to the creator’s email so they can verify login on their device without your input.
-
#start(auth_id: nil, auth_type: nil, cookies: nil, custom_proxy: nil, email: nil, force_connect: nil, name: nil, password: nil, proxy_country: nil, user_agent: nil, xbc: nil, request_options: {}) ⇒ Onlyfans::Models::AuthenticateStartResponse::UnionMember0, Onlyfans::Models::AuthenticateStartResponse::UnionMember1
Some parameter documentations has been truncated, see Models::AuthenticateStartParams for more details.
-
#submit_2fa(attempt_id, code: nil, selfie_verification_completed: nil, request_options: {}) ⇒ Onlyfans::Models::AuthenticateSubmit2faResponse
Some parameter documentations has been truncated, see Models::AuthenticateSubmit2faParams for more details.
Constructor Details
#initialize(client:) ⇒ Authenticate
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Authenticate.
157 158 159 |
# File 'lib/onlyfans/resources/authenticate.rb', line 157 def initialize(client:) @client = client end |
Instance Method Details
#poll_status(attempt_id, request_options: {}) ⇒ Onlyfans::Models::AuthenticatePollStatusResponse
Poll the status of the authentication process. Eg. if 2FA is required, we will ask you for the code using the ‘twoFactorPending = true` in the response body. For `mobile_app` auth, the response includes `mobile_auth_session_deeplink` while the session is pending.
20 21 22 23 24 25 26 27 |
# File 'lib/onlyfans/resources/authenticate.rb', line 20 def poll_status(attempt_id, params = {}) @client.request( method: :get, path: ["api/authenticate/%1$s", attempt_id], model: Onlyfans::Models::AuthenticatePollStatusResponse, options: params[:request_options] ) end |
#reauthenticate(account_id, request_options: {}) ⇒ Onlyfans::Models::AuthenticateReauthenticateResponse
Trigger account reauthentication without the need to submit email & password again.
41 42 43 44 45 46 47 48 |
# File 'lib/onlyfans/resources/authenticate.rb', line 41 def reauthenticate(account_id, params = {}) @client.request( method: :post, path: ["api/authenticate/%1$s/reauthenticate", account_id], model: Onlyfans::Models::AuthenticateReauthenticateResponse, options: params[:request_options] ) end |
#send_2fa_email(attempt_id, request_options: {}) ⇒ Onlyfans::Models::AuthenticateSend2faEmailResponse
Send 2FA verification e-mail to the creator’s email so they can verify login on their device without your input. The e-mail will be sent to the e-mail address used for signing into OnlyFans.
63 64 65 66 67 68 69 70 |
# File 'lib/onlyfans/resources/authenticate.rb', line 63 def send_2fa_email(attempt_id, params = {}) @client.request( method: :post, path: ["api/authenticate/%1$s/send-email-to-creator", attempt_id], model: Onlyfans::Models::AuthenticateSend2faEmailResponse, options: params[:request_options] ) end |
#start(auth_id: nil, auth_type: nil, cookies: nil, custom_proxy: nil, email: nil, force_connect: nil, name: nil, password: nil, proxy_country: nil, user_agent: nil, xbc: nil, request_options: {}) ⇒ Onlyfans::Models::AuthenticateStartResponse::UnionMember0, Onlyfans::Models::AuthenticateStartResponse::UnionMember1
Some parameter documentations has been truncated, see Models::AuthenticateStartParams for more details.
Start the authentication process for a new account. Supports three methods: email/password (default), cookies & headers (raw_data), or FansAPI Auth+ mobile app (mobile_app). For email/password, our systems will bypass Captcha and ask you for 2FA if required. For raw_data, provide session cookies directly for instant authentication. For mobile_app, the response includes a ‘mobile_auth_session_deeplink` that the creator opens on their phone (or scans as a QR code) to complete authentication via the FansAPI Auth+ mobile app. All credentials are stored securely and encrypted at rest.
113 114 115 116 117 118 119 120 121 122 |
# File 'lib/onlyfans/resources/authenticate.rb', line 113 def start(params = {}) parsed, = Onlyfans::AuthenticateStartParams.dump_request(params) @client.request( method: :post, path: "api/authenticate", body: parsed, model: Onlyfans::Models::AuthenticateStartResponse, options: ) end |
#submit_2fa(attempt_id, code: nil, selfie_verification_completed: nil, request_options: {}) ⇒ Onlyfans::Models::AuthenticateSubmit2faResponse
Some parameter documentations has been truncated, see Models::AuthenticateSubmit2faParams for more details.
Submit the 2FA code, or Selfie Verification status, for the authentication process.
143 144 145 146 147 148 149 150 151 152 |
# File 'lib/onlyfans/resources/authenticate.rb', line 143 def submit_2fa(attempt_id, params = {}) parsed, = Onlyfans::AuthenticateSubmit2faParams.dump_request(params) @client.request( method: :put, path: ["api/authenticate/%1$s", attempt_id], body: parsed, model: Onlyfans::Models::AuthenticateSubmit2faResponse, options: ) end |