GitHub - planningcenter/pco_api_oauth_example_sinatra_ruby: Example Sinatra + Ruby app for demonstrating how to access Planning Center's API using OAuth2

PCO API OAuth / OIDC / PKCE Example - Sinatra + Ruby

This is an example Sinatra app for demonstrating how one might build an app to authenticate any PCO user and then subsequently use that authentication to query the API using pco_api.

You can learn more about Planning Center's API here.

Setup

  1. Create an app at api.planningcenteronline.com.

    Set the callback URL to be http://localhost:4567/auth/complete.

  2. Install the required gems:

  3. Set your Application ID and Secret in the environment and run the app:

    export OAUTH_APP_ID=abcdef0123456789abcdef0123456789abcdef012345789abcdef0123456789a
    export OAUTH_SECRET=0123456789abcdef0123456789abcdef012345789abcdef0123456789abcdef0
    export PUBLIC_OAUTH_APP_ID=a9876543210fedcba987543210fedcba9876543210fedcba9876543210fedcba
    export SESSION_SECRET=some-secret-phrase-for-session-cookie-encryption-that-is-at-least-64-characters-long
    ruby app.rb
  4. Visit localhost:4567.

Copyright & License

Copyright Ministry Centered Technologies. Licensed MIT.