Class: OmniAuth::Strategies::KakaoOauth2
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::KakaoOauth2
- Defined in:
- lib/omniauth/strategies/kakao_oauth2.rb
Overview
OmniAuth OAuth2 strategy for Kakao authentication This strategy properly handles client_secret in the request body as required by Kakao's API
Instance Method Summary collapse
-
#build_access_token ⇒ Object
Override to include client_secret in request body instead of header.
Instance Method Details
#build_access_token ⇒ Object
Override to include client_secret in request body instead of header
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/omniauth/strategies/kakao_oauth2.rb', line 43 def build_access_token verifier = request.params["code"] # Build token parameters with optional client_secret in the body token_params = { redirect_uri: callback_url, client_id: .client_id, grant_type: "authorization_code" } # Include client_secret only if provided (optional parameter) token_params[:client_secret] = .client_secret if .client_secret # Merge any additional token parameters token_params.merge!(.token_params || {}) client.auth_code.get_token(verifier, token_params, deep_symbolize(.auth_token_params || {})) end |