--

Hello Dinorah.

For clarity purpose, I think you should have created a different class extending Authenticator instead of adding the method authenticate with intercept.

They implement different interfaces and also, when creating OkHttpClient, you call different methods:

builder.addInterceptor(...)

builder.authenticator(...)

You can, of course, make NetworkInterceptor extend also from Authenticator.

Besides that, great post :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Guilherme Delgado
Guilherme Delgado

Written by Guilherme Delgado

Software Engineer at BlissApplications 🇵🇹 • github.com/GuilhE • When I’m not coding I’m 🧗🏽or 🏄‍♂️

No responses yet

Write a response