Exchange a signed SIWE message for a bearer session
POST
/v1/auth/siwe
const url = 'https://testnet-rpc.necter.network/v1/auth/siwe';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"message":"example","signature":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://testnet-rpc.necter.network/v1/auth/siwe \ --header 'Content-Type: application/json' \ --data '{ "message": "example", "signature": "example" }'The Hub parses the message strictly (EIP-4361), requires domain/URI from the allow-list, Chain ID = 11155111, the nonce it issued (single use), Issued At within ±300 s, Expiration Time ≤ 24 h, the statement Sign in to Necter testnet., and recovers the EIP-191 signer = address. Contract wallets (EIP-1271) are verified with isValidSignature on Sepolia.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
message
required
string
signature
required
string
Example generated
{ "message": "example", "signature": "example"}Responses
Section titled “Responses”Session
Media typeapplication/json
object
token
required
Only returned by POST /v1/auth/siwe
string
address
required
Lowercase EVM address
string
expires_at
required
integer
roles
required
Array<string>
Example
{ "roles": [ "miner" ]}Malformed request (bad_request, invalid_field)
Media typeapplication/json
object
error
required
Stable machine code
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}Missing/invalid credentials (unauthorized, session_expired, bad_signature)
Media typeapplication/json
object
error
required
Stable machine code
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}rate_limited
Media typeapplication/json
object
error
required
Stable machine code
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example generated
{ "error": "example", "message": "example", "details": {}, "request_id": "example"}Headers
Section titled “Headers”Retry-After
integer