Skip to content

Is it possible to add an Authentication header to the RPC client? #160

@realityexpander

Description

@realityexpander

Is it possible to add an Authentication header to the RPC client?

Like this:

// App.kt

suspend fun setupRPC(): NewsService = client.rpc {
	url {
		host = DEV_SERVER_HOST
		port = 8080
		encodedPath = "/api"
	}

	headers {
		append(HttpHeaders.Authorization, "Basic YWRtaW46YWRtaW4=")
	}

	rpcConfig {
		serialization {
			json { }
		}
	}
}.withService()

I tried this, and the header is not being added to the requests.

image

If this is not the correct functionality, is the work-around to send the authentication along with the RPC calls as a parameter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions