Skip to content

'Nonce does not match' error when state data contains '=' encoded as %3D #377

Closed

Description

@BLevinger

This issue occurs when btoa appends an '=' to the stringfy data object for base64 encoding. The state data then contains a %3D encoded character after it round trips from IDP login which causes TransactionManager to attempt to locate the transaction as 'ASDF%3D' instead of 'ASDF='

	    this.auth0.authorize({
			connection: authProviders.google,
			redirectUri: document.location.protocol + "//" + document.location.host + "/register",
			state: 'ASDF='
		})
}

Issue can be resolved by adding the following on line 51 of transaction-manager.js

transaction = transaction.replace(/%3D/ig, '=')

Occurs in chrome v56

Activity

  1. BLevinger commented on Mar 6, 2017

    @BLevinger
    Author

    I've updated my own code to strip the padding character. Not sure this should be fixed in auth0 as = should not be passed in the first place but I am seeing btoa include it.

  2. hzalaz commented on Mar 6, 2017

    @hzalaz
    Contributor

    We should handle the url decoding since the state comparison is done by auth0.js.

  3. added
    bug
    on Mar 8, 2017
  4. hzalaz commented on Mar 10, 2017

    @hzalaz
    Contributor

    Closed by #382

  5. modified the milestones: , v8.4.0 on Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions