Welcome to the OAuth for MyProxy client code. This will show you how to set up a client (also know as a gateway in some places) and get it registered.
Configuration reference manual
Using self-signed certs for the client and server
Registering a client with an OAuth 1.0a server
Registering a client with an OAuth 2.0 server