dakatsuka / akka-http-oauth2-client

A Scala wrapper for OAuth 2.0 with Akka HTTP
Apache License 2.0
19 stars 14 forks source link

Trying to get it to work with Google Auth2 #1

Open PhilAndrew opened 6 years ago

PhilAndrew commented 6 years ago

Problem on getAccessToken

Can you tell me what this error means?

[info] java.lang.IllegalArgumentException: requirement failed: Illegal port: -1 [info] at scala.Predef$.require(Predef.scala:277) [info] at akka.http.scaladsl.model.headers.Host.(headers.scala:521) [info] at akka.http.scaladsl.model.headers.Host$.apply(headers.scala:516) [info] at akka.http.scaladsl.HttpExt._outgoingConnection(Http.scala:373) [info] at akka.http.scaladsl.HttpExt.outgoingConnectionHttps(Http.scala:346) [info] at com.github.dakatsuka.akka.http.oauth2.client.Config.connection(Config.scala:25) [info] at com.github.dakatsuka.akka.http.oauth2.client.Client.getAccessToken(Client.scala:23)

GRBurst commented 6 years ago

hey @PhilAndrew , did you set the code and redirect_uri parameters? they are required for the request to work. require(params.contains("code")) require(params.contains("redirect_uri"))

PhilAndrew commented 6 years ago

I gave up and made a nodejs REST version and called that from my Scala code via REST since I knew I could rely on the nodejs libraries to work and I could understand if they didn't work. I'd like to make this work later some time.