cloudfoundry-community / admin-ui-boshrelease

admin-ui-boshrelease
MIT License
17 stars 27 forks source link

"error : authorization_code grant type requires at least one redirect URL." - Creating admin-ui client #57

Open vipin-k opened 7 years ago

vipin-k commented 7 years ago

Encounter : "error_description": "authorization_code grant type requires at least one redirect URL."

When I am trying to create admin-ui client through Errand 'register_admin_ui' but encounter above error.

Any suggestion on it.

rauizab commented 7 years ago

I have this problem deploying it in my local. I fixed it by adding the redirection url to where the admin-ui is listening. If your admin-ui route is "https://admin-ui.something" then that is the value for the flag "redirect_uri" when creating the client:

uaac client add admin_ui_client \ --authorities clients.write,cloud_controller.admin,cloud_controller.read,cloud_controller.write,doppler.firehose,openid,scim.read,scim.write,sps.write \ --authorized_grant_types authorization_code,client_credentials,refresh_token \ --autoapprove true \ --redirect_uri https://admin-ui.something -s {password}

I think it is a new requirement from cf.

eskuai commented 5 years ago

How can i `set the property redirect_uri then ... because a i got error ussing uaa 4.19.2 :

    oauth:
      clients:
        uaa_admin:
          authorities: clients.read,clients.write,clients.secret,uaa.admin,scim.read,scim.write,password.write
          authorized-grant-types: password,authorization_code,client_credentials,refresh_token \
          override: true
          scope: cloud_controller.read,cloud_controller.write,openid,password.write,scim.userids,dataflow.view,dataflow.create,dataflow.manage
          secret: uaa_secret
          redirect_uri: https://uaa-service:8443
          id: uaa_admin

i got


[2019-08-14 09:29:06]uaa-????[localhost-startStop-1]DEBUG-JdbcTemplate:SQL update affected 1 rows
[2019-08-14 09:29:06]uaa-????[localhost-startStop-1] WARN-XmlWebApplicationContext:Exception encountered during context initialization - cancelling refresh attempt: org.springframework.bnException: Error creating bean with name 'clientAdminBootstrap' defined in ServletContext resource [/WEB-INF/spring/oauth-clients.xml]: Invocation of init method failed; nested exceptiont", error_description="authorization_code grant type requires at least one redirect URL. ClientID: uaa_admin"
[2019-08-14 09:29:06]uaa-????[localhost-startStop-1] INFO-MBeanExporter:Unregistering JMX-exposed beans on shutdown
[2019-08-14 09:29:06]uaa-????[localhost-startStop-1] INFO-MBeanExporter:Unregistering JMX-exposed beans on shutdown
[2019-08-14 09:29:06]uaa-????[localhost-startStop-1]ERROR-DispatcherServlet:Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientAdminBootstrap' defined in ServletContext resource [/WEB-INF/spring/oauth-clients.xml]: Invoiled; nested exception is error="invalid_client", error_description="authorization_code grant type requires at least one redirect URL. ClientID: uaa_admin"
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1634)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)

``