Class: HoninClient::PKCE

Inherits:
Object
  • Object
show all
Defined in:
lib/honin/client/pkce.rb

Constant Summary collapse

VERIFIER_LENGTH =
64

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePKCE

Returns a new instance of PKCE.



13
14
15
16
17
18
19
# File 'lib/honin/client/pkce.rb', line 13

def initialize
  @code_verifier = SecureRandom.urlsafe_base64(VERIFIER_LENGTH)
  @code_challenge = Base64.urlsafe_encode64(
    Digest::SHA256.digest(@code_verifier),
    padding: false
  )
end

Instance Attribute Details

#code_challengeObject (readonly)

Returns the value of attribute code_challenge.



11
12
13
# File 'lib/honin/client/pkce.rb', line 11

def code_challenge
  @code_challenge
end

#code_verifierObject (readonly)

Returns the value of attribute code_verifier.



11
12
13
# File 'lib/honin/client/pkce.rb', line 11

def code_verifier
  @code_verifier
end

Instance Method Details

#code_challenge_methodObject



21
22
23
# File 'lib/honin/client/pkce.rb', line 21

def code_challenge_method
  "S256"
end