Skip to content

Commit

Permalink
Merge pull request #2380 from constantine2nd/develop
Browse files Browse the repository at this point in the history
Add consumer/client name to the consent screen
  • Loading branch information
simonredfern authored Apr 30, 2024
2 parents 0e20ee7 + 5f67efd commit f375a1c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions obp-api/src/main/scala/code/snippet/ConsentScreen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ TESOBE (http://www.tesobe.com/)
package code.snippet

import code.api.util.APIUtil
import code.consumer.Consumers
import code.model.dataAccess.AuthUser
import code.util.Helper.{MdcLoggable, ObpS}
import code.util.HydraUtil.integrateWithHydra
Expand Down Expand Up @@ -75,9 +76,11 @@ class ConsentScreen extends MdcLoggable {

def consentScreenForm = {
val username = AuthUser.getCurrentUser.map(_.name).getOrElse("")
val oidcProviderDescription = getWebUiPropsValue("webui_hydra_oidc_client", "OpenID Connect Provider")
val adminApi: AdminApi = new AdminApi
val consumerKey = adminApi.getConsentRequest(consentChallengeVar.is).getClient.getClientId
val consumerName = Consumers.consumers.vend.getConsumerByConsumerKey(consumerKey).map(_.name.get).getOrElse("Unknown")
"#username *" #> username &
"#consumer_description_1 *" #> oidcProviderDescription &
"#consumer_description_1 *" #> consumerName &
"form" #> {
"#skip_consent_screen_checkbox" #> SHtml.checkbox(skipConsentScreenVar, skipConsentScreenVar(_)) &
"#allow_access_to_consent" #> SHtml.submit(s"Allow access", () => submitAllowAction) &
Expand Down

0 comments on commit f375a1c

Please sign in to comment.