Giter Club home page Giter Club logo

uaa's Introduction

Slack #uaa

CloudFoundry User Account and Authentication (UAA) Server

The UAA is a multi tenant identity management service, used in Cloud Foundry, but also available as a stand alone OAuth2 server. Its primary role is as an OAuth2 provider, issuing tokens for client applications to use when they act on behalf of Cloud Foundry users. It can also authenticate users with their Cloud Foundry credentials, and can act as an SSO service using those credentials (or others). It has endpoints for managing user accounts and for registering OAuth2 clients, as well as various other management functions.

UAA Server

The authentication service is uaa. It's a plain Spring MVC webapp. Deploy as normal in Tomcat or your container of choice, or execute ./gradlew run to run it directly from uaa directory in the source tree. When running with gradle it listens on port 8080 and the URL is http://localhost:8080/uaa

The UAA Server supports the APIs defined in the UAA-APIs document. To summarise:

  1. The OAuth2 /oauth/authorize and /oauth/token endpoints

  2. A /login_info endpoint to allow querying for required login prompts

  3. A /check_token endpoint, to allow resource servers to obtain information about an access token submitted by an OAuth2 client.

  4. A /token_key endpoint, to allow resource servers to obtain the verification key to verify token signatures

  5. SCIM user provisioning endpoint

  6. OpenID connect endpoints to support authentication /userinfo. Partial OpenID support.

Authentication can be performed by command line clients by submitting credentials directly to the /oauth/authorize endpoint (as described in UAA-API doc). There is an ImplicitAccessTokenProvider in Spring Security OAuth that can do the heavy lifting if your client is Java.

Use Cases

  1. Authenticate

     GET /login
    

    A basic form login interface.

  2. Approve OAuth2 token grant

     GET /oauth/authorize?client_id=app&response_type=code...
    

    Standard OAuth2 Authorization Endpoint.

  3. Obtain access token

     POST /oauth/token
    

    Standard OAuth2 Authorization Endpoint.

Co-ordinates

Quick Start

Requirements:

  • Java 17

If this works you are in business:

$ git clone git://github.com/cloudfoundry/uaa.git
$ cd uaa
$ ./gradlew run

The apps all work together with the apps running on the same port (8080) as /uaa, /app and /api.

UAA will log to a file called uaa.log which can be found using the following command:-

$ sudo lsof | grep uaa.log

which you should find under something like:-

$TMPDIR/cargo/conf/logs/

Demo of command line usage on local server

First run the UAA server as described above:

$ ./gradlew run

From another terminal you can use curl to verify that UAA has started by requesting system information:

$ curl --silent --show-error --head localhost:8080/uaa/login | head -1
HTTP/1.1 200

For complex requests it is more convenient to interact with UAA using uaac, the UAA Command Line Client.

Debugging local server

To load JDWP agent for UAA jvm debugging, start the server as follows:

./gradlew run -Dxdebug=true

or

./gradlew -Dspring.profiles.active=default,hsqldb,debug run

You can then attach your debugger to port 5005 of the jvm process.

To suspend the server start-up until the debugger is attached (useful for debugging start-up code), start the server as follows:

./gradlew run -Dxdebugs=true

or

./gradlew -Dspring.profiles.active=default,hsqldb,debugs run

Running local UAA server with different databases

./gradlew run runs the UAA server with hsqldb database by default.

MySql

  1. Start the mysql server (e.g. a mysql docker container)
% docker run --name mysql1 -e MYSQL_ROOT_PASSWORD=changeme -d -p3306:3306 mysql
  1. Create the uaa database (e.g. in mysql interactive session)
% mysql -h 127.0.0.1 -u root -p
...
mysql> create database uaa;
  1. Run the UAA server with the mysql profile
% ./gradlew -Dspring.profiles.active=mysql,default run

PostgreSQL

  1. Start the postgresql server (e.g. a postgres docker container)
docker run --name postgres1 -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres
  1. Create the uaa database (e.g. in psql interactive session)
% psql -h 127.0.0.1 -U postgres
create database uaa;
create user root with superuser password 'changeme';
  1. Run the UAA server with the postgresql profile
% ./gradlew -Dspring.profiles.active=postgresql,default run
  1. Once the UAA server started, you can see the tables created in the uaa database (e.g. in psql interactive session)
\c uaa
psql (14.5 (Homebrew), server 15.0 (Debian 15.0-1.pgdg110+1))
WARNING: psql major version 14, server major version 15.
         Some psql features might not work.
You are now connected to database "uaa" as user "postgres".
\d
List of relations
 Schema |             Name              |   Type   | Owner
--------+-------------------------------+----------+-------
 public | authz_approvals               | table    | root
 public | expiring_code_store           | table    | root
 public | external_group_mapping        | table    | root
 public | external_group_mapping_id_seq | sequence | root
 public | group_membership              | table    | root
 public | group_membership_id_seq       | sequence | root
 public | groups                        | table    | root
 public | identity_provider             | table    | root
 public | identity_zone                 | table    | root
 public | oauth_client_details          | table    | root
 public | oauth_code                    | table    | root
 public | oauth_code_id_seq             | sequence | root
 public | revocable_tokens              | table    | root
 public | schema_version                | table    | root
 public | sec_audit                     | table    | root
 public | sec_audit_id_seq              | sequence | root
 public | spring_session                | table    | root
 public | spring_session_attributes     | table    | root
 public | user_info                     | table    | root
 public | users                         | table    | root
(23 rows)

Running tests

You can run the integration tests with docker

$ run-integration-tests.sh <dbtype>

will create a docker container running uaa + ldap + database whereby integration tests are run against.

Using Gradle to test with postgresql or mysql

The default uaa unit tests (./gradlew test integrationTest) use hsqldb.

To run the unit tests with docker:

$ run-unit-tests.sh <dbtype>

To run a single test

The default uaa unit tests (./gradlew test) use hsqldb.

Start by finding out which gradle project your test belongs to. You can find all project by running

$ ./gradlew projects

To run a specific test class, you can specify the module and the test class.

$ ./gradlew :<project name>:test --tests <TestClass>.<MethodName>

In this example, it's running only the JdbcScimGroupMembershipManagerTests tests in the cloudfoundry-identity-server module:

$ ./gradlew :cloudfoundry-identity-server:test \
--tests "org.cloudfoundry.identity.uaa.scim.jdbc.JdbcScimGroupMembershipManagerTests"

or to run all tests in a Class

$ ./gradlew :<project name>:test --tests <TestClass>

You might want to use the full gradle command found at the bottom of the scripts/unit-tests.sh script by prepending the project name to the test command and adding the --tests option.

Building war file

$ ./gradlew :clean :assemble -Pversion=${UAA_VERSION}

Inventory

There are actually several projects here, the main uaa server application, a client library and some samples:

  1. uaa a WAR project for easy deployment

  2. server a JAR project containing the implementation of UAA's REST API (including SCIM) and UI

  3. model a JAR project used by both the client library and server

  4. api (sample) is an OAuth2 resource service which returns a mock list of deployed apps

  5. app (sample) is a user application that uses both of the above

In CloudFoundry terms

  • uaa provides an authentication service plus authorized delegation for back-end services and apps (by issuing OAuth2 access tokens).

  • api is a service that provides resources that other applications may wish to access on behalf of the resource owner (the end user).

  • app is a webapp that needs single sign on and access to the api service on behalf of users.

Running the UAA on Kubernetes

Prerequisites

The Kubernetes deployment is in active development. You should expect frequent (and possibly breaking) changes. This section will be updated as progress is made on this feature set. As of now:

The K8s directory contains ytt templates that can be rendered and applied to a K8s cluster.

In development, this Makefile can be used for common rendering and deployment activities.

In production, you'll most likely want to use ytt directly. Something like this should get you going:

$ ytt -f templates -f values/default-values.yml | kubectl apply -f -

If you'd like to overide some of those values, you can do so by taking advantage of YTT's overlay functionality.

$ ytt -f templates -f values/default-values.yml -f your-dir/production-values.yml | kubectl apply -f -

Of course, you can always abandon the default values altogether and provide your own values file.

Contributing to the UAA

Here are some ways for you to get involved in the community:

  • Join uaa on slack #uaa
  • Create github tickets for bugs and new features and comment and vote on the ones that you are interested in.
  • Github is for social coding: if you want to write code, we encourage contributions through pull requests from forks of this repository. If you want to contribute code this way, please reference an existing issue if there is one as well covering the specific issue you are addressing. Always submit pull requests to the "develop" branch. We strictly adhere to test driven development. We kindly ask that pull requests are accompanied with test cases that would be failing if ran separately from the pull request.
  • After you create the pull request, you can check the code metrics yourself
    in Github Actions and on Sonar. The goal for new code should be close to 100% tested and clean code: Quality Gate Status

Connecting UAA to local LDAP Server

Requirements:

To debug UAA and LDAP integrations, we use an OpenLdap docker image from VMWare's Bitnami project

  1. Modify file uaa/src/main/resources/uaa.yml and enable LDAP by uncommenting line 7, spring_profiles: ldap,default,hsqldb
  2. run docker-compose up from directory scripts/ldap
  3. From scripts/ldap verify connectivity to running OpenLdap container by running docker-confirm-ldapquery.sh
  4. Start UAA with ./gradlew run
  5. Navigate to /uaa and log in with LDAP user user01 and password password1

Use below command to clean-up container and volume:

  • docker-compose down --volumes

uaa's People

Contributors

6palace avatar adrianhoelzl-sap avatar andrewedstrom avatar aramprice avatar birdrock avatar bruce-ricard avatar cf-identity avatar cfryanr avatar daleolds avatar dennisdenuto avatar dependabot-preview[bot] avatar dependabot[bot] avatar dsyer avatar fhanik avatar jhamon avatar jlo avatar joeldsa avatar joshuatcasey avatar mbhave avatar medvedzver avatar peterhaochen47 avatar pjk25 avatar priyata25 avatar srwaggon avatar strehle avatar swalchemist avatar tack-sap avatar tekul avatar torsten-sap avatar vedyval avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uaa's Issues

inconsistencies login server to UAA after upgrade cf-171 to cf-180

Hi All,
we have our own, dedicated login server running together with cf-171. Everything performed as designed.
We were studying the release history documentation in order to assess changes from cf-171 until incl. to cf-180. The only high-level changes found are:

  • v178:
    • Login server v1.8.4
  • v177:
    • Login server v1.8.3
    • UAA v1.8.1
  • v175:
    • CF Security Groups are now released (?) impact to be assessed
  • v172:
    • Bump Login Server to 1.6.3
    • Bump UAA to 1.6.5
      Looking closer at documentation of v177 UAA upgrade we did not see any changes/enhancements which should indicate that login server is now incompatible with the new UAA.
      Could someone from UAA team please help us to identify what might be wrong? I would be available via Email and/or phone in order to discuss things.
      Thanks in advance.

UAA/sample/login app fix: latest version of yajl-ruby

On macosx ruby 1.9.3 it is required to use version 1.1.0 of yajl-ruby to prevent the following exception:

dyld: lazy symbol binding failed: Symbol not found: yajlset_static_value
Referenced from: /.../yajl-ruby-0.8.3/lib/yajl/yajl.bundle
Expected in: flat namespace

Modifying
https://github.com/cloudfoundry/uaa/blob/master/samples/login/Gemfile.lock#L23

- yajl-ruby (0.8.3)
+ yajl-ruby (1.1.0)

and running bundle install fixes the issue for me.

Let me know if you would like a pull request for this.

UAA responds with 400 Bad Request to `cf login`

I've upgraded my local UAA instance used for PCF RabbitMQ development and no longer can login with cf (v6). Any request I try via curl results in a 400 Bad Request response.

Git bisect suggests the first bad commit is 81f5d92.

Reverting back to ba420cb solves the issue for me. If there were any breaking changes it would be nice to have them announced somewhere. I also think UAA should keep a human readable change log (no, git log is not enough).

No bean named 'platformProperties' is defined

When checking out out the master branch and running it on the STS, it throws this exception.

I've built all the projects in the parent directory and only run UAA in tomcat container.

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'platformProperties' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:553)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:649)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    at javax.servlet.GenericServlet.init(GenericServlet.java:160)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

devuaa profile no longer valid

The README states that there is a Maven profile for testing a UAA instance of "devuaa" - this is supposed to be deployed at devuaa.cloudfoundry.com which is no longer a valid URL.

It does not look like devuaa is deployed on run.pivotal.io either.

If this is no longer valid we should clear up the various config references to this target.

User name validation bug

I believe there is a bug in the validate method of org.cloudfoundry.identity.uaa.scim.jdbc.JdbcScimUserProvisioning.java at line 178. The code is

if (!user.getUserName().matches("[a-z0-9+-_.@]+")) {
   throw new InvalidScimResourceException("Username must be lower case alphanumeric with optional characters '._@'.");
}

I think regex expression was supposed to be

if (!user.getUserName().matches("[a-z0-9+\\-_.@]+")) {

Because the - is not escaped, it's allowing all characters between + and _ which includes capital letters as well as a number of additional characters. This does not match what is stated in the error message.

I actually don't want this bug to be fixed in the way I'm suggesting :) I was hoping the user name field could be less restrictive. In my case I'm using an email address as the user name which supports many other characters.
http://stackoverflow.com/questions/2049502/what-characters-are-allowed-in-email-address
The fact that the original author allowed @ and . makes me think maybe they were also considering this possibility. My question is, can the user name field be made less restrictive or is there a valid reason for it being so restrictive? I realize the user name is used in URLs, but they could be encoded.

Thanks.

uaac - problems creating a client with implicit grant

If you create a client with implicit grant, uaac prompts you for a client secret and then errors saying that it does not need one.

$ uaac client add test --scope "test_scope" --authorized_grant_types "implicit" --signup_redirect_url "http://localhost:9000/callback"
New client secret: ********
Verify new client secret: ********

error response:
{
"error": "invalid_client",
"error_description": "Implicit grant should not have a client_secret"
}

Error parsing json in /confirm resource of login.rb sample.

Exception at line 124 of the login.rb:

NoMethodError - undefined method []' for nil:NilClass: /home/fieldj1/Documents/workspace-sts-3.1.0.RELEASE/uaa/samples/login/login.rb:124:inblock in class:LoginApplication'
/var/lib/gems/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:1212:in call' /var/lib/gems/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:1212:inblock in compile!'
/var/lib/gems/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in []' /var/lib/gems/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:inblock (3 levels) in route!'
/var/lib/gems/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:801:in `route_eval'
...

Problem is apparently caused by login.rb sample being out of date and behind the development of the uaa itself.

The fix is to change line 124 from this:

erb :confirm, :locals => {:client_id => confirmation_info["authorizationRequest" ["clientId"],
:scopes => confirmation_info["authorizationRequest"]["scope"]}

to this:

erb :confirm, :locals => {:client_id => confirmation_info["auth_request"]["authorizationParameters"]["client_id"],
:scopes => confirmation_info["auth_request"]["authorizationParameters"]["scope"]}

Persist lockout data

It appears that the UAA "lockout" data for how often a user failed to login correctly, and how long (or "if") a user is "locked out" is kept in memory and kept on a per UAA instance basis.

This means that if the UAA component is recycled then this data would be lost, or reset.
We were wondering if this data should be kept in the UAADB instead so that it can be shared across all UAA's and survive UAA restarts.

We'd be happy to work on a PR for this, but wanted to get your thoughts first before we started to head down that path.

why uaac does not use uaa API?

I traced the uaac to create new user

POST /Users HTTP/1.1
Accept: application/json;charset=utf-8
User-Agent: Ruby
Authorization: bearer eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiIyYjQ1YWM1Ni03NDk4LTQ5YjctOWJhMC01YjBiZjhmOWY2OTIiLCJzdWIiOiJwb3J0YWxfZGVtb19jbGllbnQiLCJhdXRob3JpdGllcyI6WyJzY2ltLndyaXRlIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSIsInNjaW0ucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwic2NvcGUiOlsic2NpbS53cml0ZSIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiLCJzY2ltLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImNsaWVudF9pZCI6InBvcnRhbF9kZW1vX2NsaWVudCIsImNpZCI6InBvcnRhbF9kZW1vX2NsaWVudCIsImdyYW50X3R5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE0MTA4NjAxNDMsImV4cCI6MTQxMDkwMzM0MywiaXNzIjoiaHR0cHM6Ly91YWEuMTkyLjE2OC4wLjIyMy54aXAuaW8vb2F1dGgvdG9rZW4iLCJhdWQiOlsic2NpbSIsImNsb3VkX2NvbnRyb2xsZXIiXX0.dmzKzg5ElB--oZugY6pT7s2JktNNYXscVjkxv4BPN7_y5hJ8IlpWdVMwvXSvLh2rEsmPCOe3uZXyH6fPmOy1hfXoM_QmOjeajeg2McfamGgTOupfnKKRf2x-n66XB5qBW6PxyaYy2i4bI7M59DfX9jCLm0SpmILxQQoL-i7Kbwg
Content-Type: application/json;charset=utf-8
Content-Length: 92
Connection: close
Host: 192.168.1.167:8080

{"userName":"portal_admin","password":"abc123","emails":[{"value":"[email protected]"}]}

which is not consistent with the api document: https://github.com/cloudfoundry/uaa/blob/ac69ac2ea93c6ae9d6a751adf03596a18fe0e9d5/docs/UAA-APIs.rst#create-a-user-post-users

Passowrd having curly braces

We are seeing an issue where user is not able to log in when he has a curly brace in his password. Using cf-183. Has anyone seen this issue?

Users endpoint doesn't respond properly

Playing around with the /Users endpoint with uaac, and I am seeing odd results.

I added 26 users, a - z, just to have something to play with.

  1. uaac users --start 1 --count 2341
    • returns with a 200 and 27 items which I expect admin + a-z
  2. uaac users --start 28 --count 2341
    • returns with a 200, with no resources
  3. uaac users --start 29 --count 2341
    • returns with a 500, UnexpectedError

The last is a bit unexpected given 28 returned with a 200.

Now lets go further

  1. uaac users -a name --start 1 --count 2341
    • returns with a 200, and 27 items
  2. uaac users -a name --start 1 --count 1
    • returns with a 200, and no items
  3. uaac users -a name --start 26 --count 1
    • returns with a 400, error response:
      {
      "message": "fromIndex(25) > toIndex(1)",
      "error": "scim"
      }

This just seems broken.

When UAA starts up it fails to insert users into db

Is it normal for UAA to fail to insert these users? I know they may already exsits but what if I want to change them in some way (new secret etc)?

DEBUG --- SQLErrorCodeSQLExceptionTranslator: Translating SQLException with SQ
L state '23505', error code '0', message [ERROR: duplicate key value violates unique constraint "oauth_client_details_pkey"
Detail: Key (client_id)=(servicesmgmt) already exists.]; SQL was [insert into oauth_client_details (client_secret, resource_ids, scope, authori
zed_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, client_id) values (
?,?,?,?,?,?,?,?,?,?)] for task [PreparedStatementCallback]

SCIM Unit-Test Failure on Windows Platforms

Results :

Failed tests: testListGroupsWithNameEqFilter(org.cloudfoundry.identity.uaa.scim.endpoints.ScimGroupEndpointsTests): expected:<1> but was:<0>
testListGroupsWithNameCoFilter(org.cloudfoundry.identity.uaa.scim.endpoints.ScimGroupEndpointsTests): expected:<1> but was:<0>
testListGroupsWithInvalidAttributesFails(org.cloudfoundry.identity.uaa.scim.endpoints.ScimGroupEndpointsTests): Expected test to throw (exception with message a string containing "Invalid attributes" and an instance of org.cloudfoundry.identity.uaa.scim.exception.ScimException)
testListGroupsWithNullAttributes(org.cloudfoundry.identity.uaa.scim.endpoints.ScimGroupEndpointsTests): expected:<1> but was:<0>
testUpdateNonUniqueDisplayNameFails(org.cloudfoundry.identity.uaa.scim.endpoints.ScimGroupEndpointsTests): expected:<1> but was:<0>

Tests in error:
testUpdateWithInvalidMemberFails(org.cloudfoundry.identity.uaa.scim.endpoints.ScimGroupEndpointsTests): A group with displayName: clients.read already exists.
testUpdateInvalidVersionFails(org.cloudfoundry.identity.uaa.scim.endpoints.ScimGroupEndpointsTests): A group with displayName: clients.read already exists.
testUpdateGroupWithNullEtagFails(org.cloudfoundry.identity.uaa.scim.endpoints.ScimGroupEndpointsTests): A group with displayName: clients.read already exists.
testUpdateWithQuotedVersionSucceeds(org.cloudfoundry.identity.uaa.scim.endpoints.ScimGroupEndpointsTests): A group with displayName: clients.read already exists.

Tests run: 204, Failures: 5, Errors: 4, Skipped: 1

Single Logout Out

When a user logs out of UAA, or the user is deleted, we'd like that user to be logged out of all consumer applications (if they support an SLO API).

Has anyone thought about this feature and have preferences for the APIs?

TeamCity

Hi,

Our team would really like to use uaa and login-server to deploy to our Amazon Tomcat instances. Rather than fork/customize the repositories, is there a way to provide all the configuration settings within the context of TeamCity (or similar CI environment) so that we can compile the war file and deploy it with all customized settings intact?

What's the best approach for this, i.e. environment variables, maven profiles, etc.?

Many thanks,
Matt

Support for Jackson 2

Hello,

Are there any plans to add support for Jackson 2? This prevents us (and probably many other people) to switch to Jackson 2 completely cause currently UAA forces you to use Jackson 1.

It's not a problem where Jackson 1 is used programmatically (i.e. ObjectMapper is constructed directly in code) but there are also some places where Jackson 1 annotations are used (example - Approval class). Obviously, they are not recognized by Jackson 2.

Spring does that by putting same annotations for both Jackson 1 and 2 (in order to do not break users who use Jackson 1). Probably the same approach could be implemented in UAA.

Thanks in advance

Allow usernames containing an exclamation mark

The JdbcScimUserProvisioning has a check for valid usernames defined using the following regexp "[a-zA-Z0-9+-_.@']+" which prevents username with "!" in it...and more. Is there any way to relax the constraint to allow for more characters in the username.

Errors querying Scim Users, Groups, etc with count greater than 200

An issue with JdbcPagingList was discovered while discussing #25 with Dave.

It appears that several of the Scim*Endpoints (at least user and group) take the a list from the subsequent provisioning implementation and then augment the acquired list with additional information. Membership information in the case of ScimGroupEndpoints.listGroups(). Approvals and and default groups in the case of ScimUserEndpoints.

If this list is iterated larger than the default paging size (200) then this causes loss of the augmented data at best. Exceptions at worst.

To demonstrate this problem I changed the JdbcPagingList pageSize in AbstractQueryable.query() from 200 to 3.

I then issued the command:

uaac groups --count 3 #Worked fine
uaac groups --count 4

Threw the following error:

[2013-03-14 20:03:49.091] uaa - 6168 [http-bio-8100-exec-2] .... DEBUG --- DispatcherServlet: Handler execution resulted in exception - forwarding to resolved error view: ModelAndView: materialized View is [org.cloudfoundry.identity.uaa.error.ConvertingExceptionView@42ae51c0]; model is {}
org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: (was java.lang.NullPointerException) (through reference chain: org.cloudfoundry.identity.uaa.rest.SearchResults["resources"]->java.util.ArrayList[0]); nested exception is org.codehaus.jackson.map.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: org.cloudfoundry.identity.uaa.rest.SearchResults["resources"]->java.util.ArrayList[0])
    at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.writeInternal(MappingJacksonHttpMessageConverter.java:143)
    at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:179)
    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:138)
    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:80)
    at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:94)
    at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:74)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:131)
 ...
Caused by: org.codehaus.jackson.map.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: org.cloudfoundry.identity.uaa.rest.SearchResults["resources"]->java.util.ArrayList[0])
    at org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:218)
    at org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:197)
    at org.codehaus.jackson.map.ser.std.SerializerBase.wrapAndThrow(SerializerBase.java:166)
    at org.codehaus.jackson.map.ser.std.StdContainerSerializers$IndexedListSerializer.serializeContents(StdContainerSerializers.java:127)
    at org.codehaus.jackson.map.ser.std.StdContainerSerializers$IndexedListSerializer.serializeContents(StdContainerSerializers.java:71)
    at org.codehaus.jackson.map.ser.std.AsArraySerializerBase.serialize(AsArraySerializerBase.java:86)
    at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:446)
    at org.codehaus.jackson.map.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:150)
    at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:112)
    at org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:610)
    at org.codehaus.jackson.map.ser.StdSerializerProvider.serializeValue(StdSerializerProvider.java:256)
    at org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1604)
    at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.writeInternal(MappingJacksonHttpMessageConverter.java:140)
    ... 54 more
Caused by: java.lang.NullPointerException
    at org.cloudfoundry.identity.uaa.scim.ScimGroupJsonSerializer.serialize(ScimGroupJsonSerializer.java:22)
    at org.cloudfoundry.identity.uaa.scim.ScimGroupJsonSerializer.serialize(ScimGroupJsonSerializer.java:15)
    at org.codehaus.jackson.map.ser.std.StdContainerSerializers$IndexedListSerializer.serializeContents(StdContainerSerializers.java:122)
    ... 63 more

GET /token_key documentation incorrect

The docs for Get the Token Signing key say the call is auth'd with client creds using HTTP Basic method, but that does not work. It does work using Authorization Bearer token header.

Create user failed in CloudFoundry using UAA

Hi,
I tried to create a user in CF using UAA through its REST API, but failed. what the exact request body should I post?

the code:
var options = url.parse(url.resolve('http://uaa.xxxx.com', '/Users'));
options.headers = { Authorization: 'Bearer ' + access_token , scope: 'scim.read', aud: 'scim'};
options.accept = 'application/json';
options['content-type'] = 'application/json';
options.method = 'GET';
options.scope = ['scim.read'];
options.aud = ['scim'];
var requestData = querystring.stringify({ scope: 'scim.read', aud: 'scim' });
request(options, null, function(responseCode, responseData){
var responseJson = JSON.parse(responseData);
console.log('responseData: ' + responseData);
if(responseCode != 201){
throw new Error(responseJson.description);
} else{
callback(responseJson);
}
});
it's always throw {"error":"access_denied","error_description":"Invalid token does not contain resource id (scim)"},
how should I pass the scim id? could you give an example? thanks very much in advance!

Encoding/decoding issues with handling of redirect_uri

Our console is forwarding a request to the login server that contains a url encoded redirect_url:

https://example.com/dashboard/?appGuid=app-guid&ace_config=%7B%22orgGuid%22%3A%22org-guid%22%2C%22spaceGuid%22%3A%22space-guid%22%2C%22appGuid%22%3A%22app-guid%22%2C%22redirect%22%3A%22https%3A%2F%2Fexample.com%2F%22%7D

When we redirect to the login server, the request looks like this:

https://login.example.com/UAALoginServerWAR/oauth/authorize?response_type=code&client_id=client_id&scope=openid%2Ccloud_controller.read&redirect_uri=https%3A%2F%2Fexample.com%2Fdashboard%2F%3FappGuid%3Dapp-guid%26ace_config%257B%2522orgGuid%2522%253A%2522org-guid%2522%252C%2522spaceGuid%2522%253A%2522space-guid%2522%252C%2522appGuid%2522%253A%2522app-guid%2522%252C%2522redirect%2522%253A%2522https%253A%252F%252Fexample.com%252F%2522%257D&state=-1504060196

Later, when the UAA redirects back to the console, the URL looks like this:

https://example.com/dashboard/?appGuid=app-guid&ace_config=%257B%2522orgGuid%2522%253A%2522org-guid%2522%252C%2522spaceGuid%2522%253A%2522space-guid%2522%252C%2522appGuid%2522%253A%2522app-guid%2522%252C%2522redirect%2522%253A%2522https%253A%252F%252Fexample.com%252F%2522%257D&code=1WaJaV&state=-1504060196

It appears that the %encoding of % is not being handled correctly. This behavior difference seems to have been introduced between 1.8 and 1.11.

UAA does not properly encode redirect URIs

After analysis, we think the root cause is that UAA server doesn't encode the "state" parameter. We use a random generator for "state" parameter. There could be special characters, but we encode them before sending out. It seems the UAA server doesn't encode it when sending back, so that the comparison of "state" will fail.

This issue was also fixed in spring-security-oauth, see spring-attic/spring-security-oauth#152

Something like oauth/authorize?....&state=a%2Bb comes back as ...&state=a+b which is incorrect.

Quick start build instructions do not build the uaa

I was trying to build the uaa today by following the 'quick start' commands and the build fails:

$ git clone git://github.com/cloudfoundry/uaa.git
$ cd uaa
$ mvn install

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (generate-sql) on project cloudfoundry-identity-common: Execution generate-sql of goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-antrun-plugin:1.6:run: java.lang.NoSuchMethodError: org.codehaus.plexus.util.FileUtils.fileWrite(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

The full trace of my errors is available here:
https://gist.github.com/trastle/6376365

Default CLOUD_FOUNDRY_CONFIG_PATH to config?

It took me a while to figure out that my changes to the sample config file weren't getting picked up unless I set CLOUD_FOUNDRY_CONFIG_PATH. Is there a reason to not have it pick up the default one?

Authentication with strange username

When the user "a@" wants to authenticate, a runtime exception is thrown.
I will submit a pull request which fixes this an similar issues shortly.

java.lang.ArrayIndexOutOfBoundsException: 1
org.cloudfoundry.identity.uaa.authentication.manager.LoginAuthenticationManager.getUser(LoginAuthenticationManager.java:140)
org.cloudfoundry.identity.uaa.authentication.manager.LoginAuthenticationManager.authenticate(LoginAuthenticationManager.java:79)
org.cloudfoundry.identity.uaa.authentication.AuthzAuthenticationFilter.doFilter(AuthzAuthenticationFilter.java:130)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:131)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.cloudfoundry.identity.uaa.security.web.SecurityFilterChainPostProcessor$UaaLoggingFilter.doFilter(SecurityFilterChainPostProcessor.java:186)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)

Take 2: inconsistencies login server to UAA after upgrade cf-171 to cf-180

Opening this as issue #97 was closed, and I don't think the discussion there makes sense yet. Specifically, I've added a comment to #97 requesting further clarification on why a loginserver should need to pass a client_secret when acting on behalf of another client in communications with the /authorize endpoint.

Passing the loginserver's access token is essentially the secret required to ensure integrity for that use case.

/approvals endpoint is not protected with special scope

Hi,
I just found that the /approvals endpoint which is used to approval/revoke scope(authorization) to client app, is not protected by a special scope.
It only requires "IS_AUTHENTICATED_FULLY" which means that any client app with a access token can invoke /approvals to change its or other apps' scopes.

I tried to access this endpoint with a arbitrary token and successfully grant other scopes to client app.

Is this a reasonable behavior or a potential security vulnerability?

UAA - SCIMUsers - Search API

There is not way to retrieve sub-list or page through when request is for all attributes of 'user'.

File: uaa/scim/src/main/java/org/cloudfoundry/identity/uaa/scim/endpoints/ScimUserEndpoints.java

if (!StringUtils.hasLength(attributesCommaSeparated)) {
// Return all user data
return new SearchResults(Arrays.asList(ScimCore.SCHEMAS), input, startIndex, count, result.size());
}

Here whole "input" list is returned when attributesCommaSeparated is empty.

Though we can page through when request asks for certain attributes.

Update to Javaconfig and Spring Boot

Spring Boot should simplify some of the config (maybe with some name changes), and also make the app deployable from the war file trivially (great for devs that depend on UAA - no need for Maven or Tomcat installation). It would also be good to get the UAA onto to the "modern" standards for Spring apps. I've been doing some work here (see https://github.com/dsyer/uaa/tree/feature/bootify).

Post user failed: Could not read JSON: unrecognized field\n at [Source

Hi,
I just want to create a user with UAA by REST API.

My step:

  1. get authorization
    var options = url.parse('http://uaa.xxxxx.com/oauth/token');
    delete options.href;
    var requestData = querystring.stringify({ grant_type: 'password', username: username, password: password, aud: 'scim', scope: 'scim.write' });
    options.path = options.path + '?' + requestData;
    options.method = 'POST';
    options.accept = 'application/json';
    options['content-type'] = 'application/json'
    options.headers = { authorization: 'Basic Y2Y6', 'content-length': requestData.length };
    options.query = requestData;
    request(options, requestData, function(statusCode, authorizationData){
        if(statusCode == 200){
            var authorization = JSON.parse(authorizationData);
            callback(authorization.access_token);                   
        } else{
            throw { message: 'Invalid response: ' + statusCode } ;
        }
    });
  1. Post a user

    var data = {
        email: 'xxx@email',
        schemas: ['urn:scim:schemas:core:1.0'],
        userName: 'bjensen',
        name: {
            formatted: 'Ms. Barbara J Jensen III',
            familyName: 'Jensen',
            givenName: 'Barbara'
        }
    };
    var options = url.parse(url.resolve('http://uaa.xxx.com', '/Users'));
    delete options.href;
    var requestData = querystring.stringify(data);
    options.path = options.path + '?' + requestData;
    options.method = 'POST';
    options.accept = 'application/json;charset=utf-8';
    options['Content-Type'] = 'application/json;charset=utf-8'
    options.headers = { authorization: 'Bearer ' + access_token };
    options.query = requestData;
    request(options, requestData, function(statusCode, user){
        if(statusCode == 200){
            callback(user);                   
        } else{
            throw { message: 'Invalid response: ' + statusCode } ;
        }
    });
    

it failed with:
Request data: {"email":"[email protected]","userName":"bjensen","name":{"formatted":"Ms. Barbara J Jensen III","familyName":"Jensen","givenName":"Barbara"}}
STATUS: 400
HEADERS: {"connection":"close","content-language":"en-US","content-type":"application/octet-stream;charset=ISO-8859-1","date":"Wed, 16 Jul 2014 13:47:45 GMT","server":"Apache-Coyote/1.1","content-length":"354"}
DATA: {"message":"Could not read JSON: unrecognized field\n at [Source: org.apache.catalina.connector.CoyoteInputStream@5e5f3833; line: 1, column: 11]; nested exception is org.codehaus.jackson.map.exc.UnrecognizedPropertyException: unrecognized field\n at [Source: org.apache.catalina.connector.CoyoteInputStream@5e5f3833; line: 1, column: 11]","error":"scim"}
โ€ค

could you help take a look? thanks much!

Rest API docs have invalid JSON in examples

The examples for client administration in
https://github.com/cloudfoundry/uaa/blob/master/docs/UAA-APIs.rst#client-registration-administration-apis

are missing all the quotes around the JSON strings and key names.
This can be confusing for people who are copying and pasting the POST/PUT examples since they are rejected by the server.

Examples

PUT /oauth/clients/foo/secret
{
  oldSecret: fooclientsecret,
  secret: newclientsceret
}

should be

PUT /oauth/clients/foo/secret
{
  "oldSecret": "fooclientsecret",
  "secret": "newclientsceret"
}

Strange behavior during creation of new oauth_client_details.

Hello,
We have a problem with creating new oauth_client_details (createClientDetails from ClientAdminEndpoints). We have an user A with group membership in "uaa.admin" and a client B with scope "uaa.admin". We get access token for user A with authorization_code grant type which contains "uaa.admin" scope.
When we sent a request for creating new client with scope "resource.write" (User A and client B doesn't have this scope) we got "InvalidClientDetailsException"
It fails because isAdmin mehtod checks only user authentication authorities and ignores client scopes. But user authentication has only "uaa.user" authority.
Is it correct behavior for this endpoint? It looks like this endpoint designed only for client_credentials grant type.
Thank you.

UAA AccessController doesn't check APPROVED or DENIED scopes expiration date.

Hello,

Currently AccessController distributes scopes over the 'approved', 'denied' and 'undecided' groups which are later displayed on the access_confirmation.jsp page.
The problem we see that it's a little bit confusing when expired approved or denied scopes are still displayed under the "You have already approved/denied clientId with access to the following" heading.
It seems that these scopes should go to the 'undecided' group. Could you please clarify whether our assumptions are correct and whether there will be plans to fix this?

Thanks in advance

YamlConfigurationValidator: Failed to load YAML validation bean.

I started uaa with uaa.yml , but it output some errors:

below is my uaa.yml and uaa.log

is there something wrong with my uaa.yml?

==================== uaa.yml ======================

pid: /tmp/uaa.pid
mbus: nats://localhost:4222
oauth:
client:
override: true
autoapprove:
- cf
clients:
cf:
override: true
authorized-grant-types: password,implicit
authorities: uaa.none
scope: cloud_controller.read,cloud_controller.write,openid,password.write,cloud_controller.admin,scim.read,scim.write

jwt:
token:
signing-key: 'tokensecret'
verification-key: 'tokensecret'
scim:
userids_enabled: false
user.override: true
users:
- admin|password|scim.write,scim.read,openid,cloud_controller.admin

==================== uaa.log ======================
[2013-10-14 10:57:40.031] uaa/uaa - ???? [main] .... ERROR --- YamlConfigurationValidator: Failed to load YAML validation bean. Your YAML file may be invalid.
Can't construct a java object for tag:yaml.org,2002:org.cloudfoundry.identity.uaa.UaaConfiguration; exception=Cannot create property=pid for JavaBean=org.cloudfoundry.identity.uaa.UaaConfiguration@3f0ae1f9; Unable to find property 'pid' on class: org.cloudfoundry.identity.uaa.UaaConfiguration
in 'string', line 1, column 1:
pid: /tmp/uaa.pid
^

at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:333)
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:141)
at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:127)
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:481)
at org.yaml.snakeyaml.Yaml.load(Yaml.java:400)
at org.cloudfoundry.identity.uaa.config.YamlConfigurationValidator.afterPropertiesSet(YamlConfigurationValidator.java:79)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:591)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)
at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Caused by: org.yaml.snakeyaml.error.YAMLException: Cannot create property=pid for JavaBean=org.cloudfoundry.identity.uaa.UaaConfiguration@3f0ae1f9; Unable to find property 'pid' on class: org.cloudfoundry.identity.uaa.UaaConfiguration
at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:299)
at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:189)
at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:331)
... 56 more
Caused by: org.yaml.snakeyaml.error.YAMLException: Unable to find property 'pid' on class: org.cloudfoundry.identity.uaa.UaaConfiguration
at org.yaml.snakeyaml.introspector.PropertyUtils.getProperty(PropertyUtils.java:132)
at org.yaml.snakeyaml.introspector.PropertyUtils.getProperty(PropertyUtils.java:121)
at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.getProperty(Constructor.java:308)
at org.cloudfoundry.identity.uaa.config.CustomPropertyConstructor$CustomPropertyConstructMapping.getProperty(CustomPropertyConstructor.java:54)
at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:240)
... 58 more

UAA does not return the Cookie

According to the docs:
https://github.com/cloudfoundry/uaa/blob/master/docs/UAA-APIs.rst#trusted-authentication-from-login-server

Request header:

Accept: application/json Authorization: Bearer <login-client-bearer-token-obtained-from-uaa>
.....

Response header will include a cookie.

If I set an Accept: application/json, there is no Set-Cookie in the response.
If I set Accept to anything else, the Set-Cookie appears.

Is this a bug in the code or a mistake in the docs?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.