Class: Gosns::Linkedin
Class Attribute Summary collapse
-
.key ⇒ Object
Returns the value of attribute key.
-
.redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
-
.secret ⇒ Object
Returns the value of attribute secret.
Attributes inherited from Sns
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Sns
Constructor Details
This class inherits a constructor from Gosns::Sns
Class Attribute Details
.key ⇒ Object
Returns the value of attribute key.
5 6 7 |
# File 'lib/provider/linkedin.rb', line 5 def key @key end |
.redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
5 6 7 |
# File 'lib/provider/linkedin.rb', line 5 def redirect_uri @redirect_uri end |
.secret ⇒ Object
Returns the value of attribute secret.
5 6 7 |
# File 'lib/provider/linkedin.rb', line 5 def secret @secret end |
Class Method Details
.get_token(code) ⇒ Object
22 23 24 |
# File 'lib/provider/linkedin.rb', line 22 def get_token(code) oauth_client.auth_code.get_token(code, redirect_uri: redirect_uri).token end |
.oauth_authorize_url ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/provider/linkedin.rb', line 6 def state = 'DCEeFWf45A53sdfKef424' oauth_client.auth_code.( redirect_uri: redirect_uri, state: state, ) end |
.oauth_client ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/provider/linkedin.rb', line 13 def oauth_client option = { site: 'https://www.linkedin.com', authorize_url: "/uas/oauth2/authorization", token_url: "/uas/oauth2/accessToken" } OAuth2::Client.new(key, secret, option) end |