class

Authly::DeviceCode

Inherits Authly::GrantStrategy < Reference < Object

Constants

SLOW_DOWN_STEP = 5

RFC 8628 section 3.5: seconds added to the interval each time the device polls too fast.

USER_CODE_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789"

No 0, 1, I or O. Eight of 32 characters are 40 bits, which the attempt limit at the verification page makes unguessable.

Constructors

new(client_id : String, device_code : String)
Source

Class methods

create_device_authorization(client_id : String, scope : String) : DeviceCodeData
Source
generate_user_code
Source
normalize_user_code(input : String | Nil) : String | Nil

What a person typed as "ABCD-EFGH" (any case, dash optional, surrounding blanks), or nil when it cannot be a user code, so nothing malformed ever reaches a store.

Source

Instance methods

authorized?
Source
client_id
Source
device_code
Source
subject

The owner who approved the device, so the token is about them and not about nobody.

Source