Friday, August 29, 2014

Getting Started with oc-id and Supermarket [feedly]



----
Getting Started with oc-id and Supermarket
// Chef Blog

Enterprise Chef 11.2.0 includes oc-id, the OAuth2 service that powers id.opscode.com.   After upgrading to this release, Chef customers can run their own Supermarket service behind a firewall.

oc-id setup:

1: Add the following setting to your /etc/opscode/private-chef.rb configuration file and then run 'private-chef-ctl reconfigure':

ocid['administrators'] = ["boiardie"]  

This must be an Array of Enterprise Chef users who are authorized to manage the oc-id service.

2: Log in to your Enterprise Chef server's oc-id management portal at https://mychefserver/id and you will be directed to the oc-id authentication page. Log in as an administrative user as defined in step 1, and you will be displayed a screen showing that you don't have any authorized applications:

3: Change your URL to https://mychefserver/id/oauth/applications (sorry, there's no button or link to do this yet) and you'll see a screen to add/manage applications:

NOTE: Applications in this context refers to OAuth2 client systems that will authenticate against the oc-id service (like Supermarket).

4: Click the New Application button and fill in the application name and Redirect url:

NOTE: the Redirect URL must contain the oauth2 callback URL, which is /auth/chef_oauth2/callback for supermarket.
NOTE2: If your users access the supermarket server by different URLs please note those here.

5: After you click Submit you will be shown the Application Id and Secret strings which you must supply to Supermarket.  Copy these down, but don't worry about losing them. You can always retrieve them from the /id/oauth/applications URL of your Chef server.

 

Supermarket setup

Currently Supermarket does not have an Omnibus package and must be configured using the supermarket cookbook.  These instructions will use test-kitchen to setup your Supermarket instance in Vagrant.

1:  Download the supermarket cookbook, and edit the .kitchen.yml file to add a privatenetwork IP address:

---   driver:   name: vagrant   customize:   memory: 1024   network:     - ["private_network", {ip: "33.33.33.30"}]  

2: Edit the chef_oauth2 section of the data_bags/apps/supermarket.json file.  Note that the url field is the URL of your Chef server without a URI.

"chef_oauth2": {  "app_id": "14dfcf186221781cff51eedd5ac1616761b31e8947e51f28232537313c5c9c40",  "secret": "a49402219627cfa6318d58b13e90aca164aad2e263fb8f05b766e01f97450c1d",  "url": "https://54.187.77.86"  },  

3:  Fire up your supermarket instance

kitchen converge default-ubuntu-1404

4:  Once running navigate to http://33.33.33.30 and log in to your new Supermarket instance.   You will see a request to authorize the application. This only needs to happen once.

5:  Success!  You should be logged in to your Supermarket server as the requested user.

oc-id Caveats as of EC 11.2.0

  • There is a known issue with Supermarket that it verifies the SSL certificate of the oc-id server and this setting cannot be overridden (workaround provided).
    • When this happens (at application authorization time) users will only be displayed a generic "something went wrong" error message.
  • There is no link to the application management interface in oc-id, you must enter it manually.
  • If you are not logged in as an oc-id administrator, the application management URL will display a 404 "Page Not Found" error instead of a 403.
  • Many of the links in Supermarket will take you to manage.opscode.com instead of your Chef server

 


----

Shared via my feedly reader


Sent from my iPhone

No comments:

Post a Comment