Skip to content

Signature Not working on IOS #4

@DenJohX

Description

@DenJohX

Using the React-Native 0.34.0, the output of jwt.encode(payload, jwtSecret) doesn't have a valid signature. This doesn't happens on android.

Using this code:

        const testData = {bar: 'baz', bacon: 'eggs'}
        const testSecret = 'sert212msrghwierlskdSSDt'
        const testPayload = {
            exp: (Date.now() / 1000) + 30,
            lg: 'en',
            data: testData
        }
        const jwtToken = jwt.encode(testPayload, testSecret)

The output for android:

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0Nzc1OTQ4MjEuMDkxLCJsZyI6ImVuIiwiZGF0YSI6eyJiYXIiOiJiYXoiLCJiYWNvbiI6ImVnZ3MifX0=.98QwgX3EsaSEbM8u43vhyVFiFWGk890idNHGGVMv9Ko

The output for ios:

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0Nzc1OTQ5MjUuOTgyLCJsZyI6ImVuIiwiZGF0YSI6eyJiYXIiOiJiYXoiLCJiYWNvbiI6ImVnZ3MifX0=.vKHO8KSDGTXM7SxcqVIg0HnC1Ib0rriTl1gQYy_4hEUhEUAAAAA

Both can be decoded as tested on jwt.io, but the signature is invalid for ios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions