OIDC client sample in .NET
- Source code : https://svn.wso2.org/repos/wso2/people/lahiruc/oidc_sample/
- Start the IS server and login to the management console.
- Navigate to the Main tab and click on Add under Service Providers.
- Create a Service provider. Expand the Inbound Authentication and Configuration section and configure call back url : [server-url]/callback.aspx (callback asp form of the .NET project)
- Select Configuration (under Oauth/OpenID Connect Configuration)
- Start the .NET application and fill the necessary details (eg: client id/ request uri etc), then it gets redirected to the IS authentication endpoint
(Note: Client key/secret can be found under Inbound Authentication and Configuration section of the created SP)
- Authenticate via IS
- Select Approve/Always Approve
- After successfully authenticated, user gets redirected back to callback page with the oauth code. Then we need to fill the given information (eg: secret/grant type etc) and submit the form to retrieve the token details. It does a REST call to token endpoint and retrieve the token details. Since it does a server to server call we need to import the IS server certificate and export to Visual Studio Management Console to avoid SSL handshake exceptions.
- Once the REST call is succeeded we could see the token details alone with the base64 decoded JWT (ID Token) details.