Skip to content

Commit

Permalink
#264 Fix OAuth scope config type
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani authored and To-om committed Oct 28, 2020
1 parent 4fed539 commit 70dcf09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/org/thp/cortex/services/OAuth2Srv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case class OAuth2Config(
authorizationUrl: String,
tokenUrl: String,
userUrl: String,
scope: String,
scope: Seq[String],
authorizationHeader: String,
autoupdate: Boolean,
autocreate: Boolean
Expand All @@ -41,7 +41,7 @@ object OAuth2Config {
authorizationUrl <- configuration.getOptional[String]("auth.oauth2.authorizationUrl")
tokenUrl <- configuration.getOptional[String]("auth.oauth2.tokenUrl")
userUrl <- configuration.getOptional[String]("auth.oauth2.userUrl")
scope <- configuration.getOptional[String]("auth.oauth2.scope")
scope <- configuration.getOptional[Seq[String]]("auth.oauth2.scope")
authorizationHeader = configuration.getOptional[String]("auth.oauth2.authorizationHeader").getOrElse("Bearer")
autocreate = configuration.getOptional[Boolean]("auth.sso.autocreate").getOrElse(false)
autoupdate = configuration.getOptional[Boolean]("auth.sso.autoupdate").getOrElse(false)
Expand Down Expand Up @@ -109,7 +109,7 @@ class OAuth2Srv(
private def authRedirect(oauth2Config: OAuth2Config): Result = {
val state = UUID.randomUUID().toString
val queryStringParams = Map[String, Seq[String]](
"scope" -> Seq(oauth2Config.scope),
"scope" -> Seq(oauth2Config.scope.mkString(" ")),
"response_type" -> Seq(oauth2Config.responseType),
"redirect_uri" -> Seq(oauth2Config.redirectUri),
"client_id" -> Seq(oauth2Config.clientId),
Expand Down

0 comments on commit 70dcf09

Please sign in to comment.