---
schema_version: "1"
id: ab63e18a0a79b9ce96a5d778db0c60281ea7abfdc3e1902418accfdf94a61a31
title: Decode the JWT
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-app-development/decode-jwt.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/decode-jwt.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 522741f27b08715433c919068056ec662a1df406d4e3f5e56d828c1385e223dc
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Decode the JWT

You application login page needs to decode the JWT passed to it and leverage the information as needed. You need two pieces of information to decode the JWT:

1.  `encodedJWT` = The JWT passed to the page.
2.  `secret` = The JWT signing secret key for your application used to decode the endcoded JWT. This value is stored on the installed package.

Check out our downloadable SDKs to see coding examples in a variety of languages. Below are examples of just the JWT decoding piece, leveraging external libraries referenced in the Resources section below.

## C# Example of Decoding a JWT

```java
using JWT; // install from https://github.com/johnsheehan/jwt
using Newtonsoft.Json.Linq;

namespace Example
{
    public class ExampleClass
    {
        string encodedJWT = "jwttokengoeshere";
        string secret = "mysecret";
        string decodedJWT = JWT.JsonWebToken.Decode(encodedJWT, secret);
        JObject parsedJWT = JObject.Parse(decodedJWT);
    }
}
```

### node.js Example of Decoding a JWT

```javascript
var jwt = require("jwt-simple"); // install with: 'npm install jwt-simple'
var encodedJWT = "jwttokengoeshere";
var secret = "mysecret";
var decodedJWT = jwt.decode(encodedJWT, secret);
```

## PHP Example of Decoding a JWT

```php
<?php
require_once 'JWT.php'; // install from https://github.com/luciferous/jwt
$encodedJWT = 'jwttokengoeshere';
$secret = 'mysecret';
$decodedJWT = JWT::decode($encodedJWT, $secret);
?>
```

## Ruby Example of Decoding a JWT

```ruby
require "jwt"
@encodedJWT = 'jwttokengoeshere';
@secret = 'mysecret';
@decodedJWT = JWT.decode(@encodedJWT.to_s,nil,@secret)
```

## Related Items

- [Single Sign On](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/single-sign-on.md)
- [Encoded JWT](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/encoded-jwt.md)
- [Explanation of Decoded JWT](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/explanation-decoded-jwt.md)
