This section is about configuring the 2-legged OAuth scenario in OpenSocial. (Reference: [OpenSocial.org|http://docs.opensocial.org/display/OS/Home])

For more information, visit [2-legged OAuth for the OpenSocial REST API.|http://sites.google.com/site/oauthgoog/2leggedoauth/2opensocialrestapi]

{docbook}
<para xml:id="SOCref.Configuration.Generate_certificate">
<citetitle>
<emphasis role="bold">
Generate the key
</emphasis>
</citetitle>
</para>
{docbook}

{code}
$ openssl req -newkey rsa:1024 -days 365 -nodes -x509 -keyout testkey.pem \
     -out testkey.pem -subj '/CN=mytestkey'
$ openssl pkcs8 -in testkey.pem -out oauthkey.pem -topk8 -nocrypt -outform PEM
{code}

{docbook}
<para xml:id="SOCref.Configuration.Configure_the_property_life">
<citetitle>
<emphasis role="bold">
Configure the property file
</emphasis>
</citetitle>
</para>
{docbook}

Edit _container.js_ and change the following parameter to point to your private key and key name.

{code}
"gadgets.signingKeyFile" : "oauth.pem",
"gadgets.signingKeyName" : "oauthKey",
{code}

{docbook}
<para>
<prompt>
   <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}

* [UI Extensions|#SOCref.DevelopersReferences.UIExtensions]
* [Overridable Components|#SOCref.DevelopersReferences.OverridableComponents]
* [Public Java APIs|#SOCref.DevelopersReferences.PublicJavaAPIs]
* [Java APIs sample code/ tutorial|#SOCref.DevelopersReferences.SampleCode_Tutorial]
* [Public REST APIs|#SOCref.DevelopersReferences.PublicREST_APIs]
* [Rest Service APIs|#SOCref.DevelopersReferences.RestService_APIs]
* [Public Javascript APIs|#SOCref.DevelopersReferences.PublicJavascriptAPIs]
* [Social JCR Structure|#SOCref.Social_JCR_Structure]
* [Spaces Template configuration|#SOCref.Space_Template_Configuration]
