Shopify.Multipass (exshopify v0.11.0)

Logins can be accomplished by enabling the Multipass feature on your Shopify Plus account. This requires the use of a special Multipass session token. https://help.shopify.com/en/api/reference/plus/multipass

Link to this section Summary

Functions

Encrypts a message using the given encryption key. This will pad the message according to the block size. Returns the encrypted message as cipher text.

Simple getter to expose the module attribute

Splits the multipass secret into 2 binaries, each containing exactly the block size number of bytes. Returns a tuple where the first item is the encryption_key, the second is the signature_key

Calculates the Shopify Multipass token: an encrypted and signed message containing the customer data to be used for the Multipass SSO.

Pads the message string with extra bytes to ensure it is evenly divisible by the block size. See http://erlang.org/doc/man/crypto.html#block_encrypt-4

Signs the given cipher text message using the provided signature key

Link to this section Functions

Link to this function

encrypt(message, encryption_key, block_size \\ 16)

Specs

encrypt(binary(), binary(), integer()) :: binary()

Encrypts a message using the given encryption key. This will pad the message according to the block size. Returns the encrypted message as cipher text.

Link to this function

get_block_size()

Simple getter to expose the module attribute

Link to this function

get_keys(multipass_secret, block_size \\ 16)

Specs

get_keys(binary(), integer()) :: tuple()

Splits the multipass secret into 2 binaries, each containing exactly the block size number of bytes. Returns a tuple where the first item is the encryption_key, the second is the signature_key

Link to this function

get_token(customer_data, multipass_secret, config_opts \\ %{})

Specs

get_token(map(), binary(), map()) :: binary()

Calculates the Shopify Multipass token: an encrypted and signed message containing the customer data to be used for the Multipass SSO.

Link to this function

get_url(shop_name, customer_data, multipass_secret, config_opts \\ %{})

Specs

get_url(binary(), map(), binary(), map()) :: binary()

Get the full URL for the Multipass signin.

Link to this function

pad(string, block_size \\ 16)

Specs

pad(binary(), integer()) :: binary()

Pads the message string with extra bytes to ensure it is evenly divisible by the block size. See http://erlang.org/doc/man/crypto.html#block_encrypt-4

Link to this function

sign(cipher_text, signature_key)

Specs

sign(binary(), binary()) :: binary()

Signs the given cipher text message using the provided signature key