title: Authentication role - Clean Architecture
body: <p>Lately I have been facing a problem that I wasn't able to came out with a solution,  I am building an android application following the Clean Architecture and everything was going fine until I had to think about the authentication role.</p>
  
  <p>I have this structure (layers) on my app: 
  [ui](activities and fragments) -> [presentation](view models) -> [domain](use case) -> data -> [remote, cache, database].</p>
  
  <p>Now, let's suppose that I want to log in into my app, first I'll go through the login screen and put users credentials, after that I'll call the LoginViewModel and then the LoginUseCase passing the email and password. In its turn, the use case will call the repository, let's say, authenticate and then I'll make a request to the backend with the credentials, if everything's ok then I'll receive back a token that I should store in some fashion, the problem start here, I've created a interceptor that is responsible to get the token from the header, but I have to save it and for that I need to access the shared preferences, is correct to have access to it inside my interceptor? And in every request I had to send it  to my backend, what's the best approach ? </p>
  
  <p>I also saw this tutorial <a href="https://medium.com/@tsaha.cse/advanced-retrofit2-part-2-authorization-handling-ea1431cb86be" rel="nofollow noreferrer">https://medium.com/@tsaha.cse/advanced-retrofit2-part-2-authorization-handling-ea1431cb86be</a> but I think that it's not correct to have access to database inside your application class, am I wrong?</p>
  
  <p>Thank you all for reading this, I'm struggling to find out the best approach, so any help are welcome. </p>