UniWebViewAuthenticationUtils

Summary

This class provides some helper utils for performing the authentication flow.

They are used inside the built-in flows, but you can also use them to implement your own flow.

Methods Summary

Generates a random Base64 encoded string.

Generates a random Base64URL encoded string.

Converts a Base64 encoded string to a Base64URL encoded string.

Converts a Base64URL encoded string to a Base64 encoded string.

Generates a code verifier for PKCE usage.

Calculates the code challenge for PKCE usage, with a given code verifier and hash method.

Methods

Generates a random Base64 encoded string.

Return Value

A random Base64 encoded string.

Generates a random Base64URL encoded string.

Return Value

A random Base64URL encoded string.

Converts a Base64 encoded string to a Base64URL encoded string.

Parameters
  • string input

    The Base64 encoded string.

Return Value

A string with Base64URL encoded for the input.

Converts a Base64URL encoded string to a Base64 encoded string.

Parameters
  • string input

    The Base64URL encoded string.

Return Value

A string with Base64 encoded for the input.

Generates a code verifier for PKCE usage.

Parameters
  • int length

    The length of the target code verifier. Default is 64.

Return Value

A generated code verifier for PKCE usage.

Calculates the code challenge for PKCE usage, with a given code verifier and hash method.

Parameters
  • string codeVerifier

    The code verifier you generated.

  • UniWebViewAuthenticationPKCE method

    The hash method you want to use.

Return Value

The result of the code challenge.