Log in with account proof data to retrieve user's flow account address along with account proof.
If dApp chooses to ask user for user's authentication in this way, and the user approves the signing of message data, it will return user's flow account address with accountProofData that can be used to prove a user controls an on-chain account.
importFCL_SDKlet accountProofData =FCLAccountProofData( appId:"Here you can specify your app name.", nonce:"75f8587e5bd5f9dcc9909d0dae1f0ac5814458b2ae129620502cb936fde7120a"// minimum 32-byte random nonce as a hex string.)Task{do {let address =tryawait fcl.authanticate(accountProofData: accountProofData)}catch{ // handle error here}}
fcl.authanticate is also called behide fcl.login() with accountProofData set to nil.
Both methods above store address under fcl.currentUser , to get user address just simply call as below.
To get user address or account proof after user authenticated, just simply call as below.
Verify account proof
Cadence has a built-in function called verify that will verify a signature against a Flow account given the account address.
FCL-Swift includes a utility function in AppUtilities, verifyAccountProof, for verifying one or more account proof signatures against an account's public key on the Flow blockchain.
BLOCTO_FCLCRYPTO_CONTRACT_ADDRESS can be found here
input parameter appIdentifier should be exactly same with FCLAccountProofData 's appId above. They should all be a human readable string.