如何使用Retrofit Android进行OAuth 2.0 [英] How to OAuth 2.0 with Retrofit Android

查看:257
本文介绍了如何使用Retrofit Android进行OAuth 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Retrofit库,我想在每个API调用上实现OAuth 2.0,以对这些调用进行身份验证.我该如何实现?你能一步一步解释我吗?我关注了一些博客,但不知道该怎么做.

I'm using Retrofit library and I wanted to implement OAuth 2.0 on every API call in order to authenticate those calls. How can I achieve that? Can you explain me step by step? I have followed some blogs but didn't understand how to do that.

推荐答案

我强烈建议您检查

I highly recommend you to check u2020 source code. You can achieve this with a OkHttp interceptor (Retrofit 1.x or Retrofit 2.x) or a RequestInterceptor if you stay with Retrofit 1.x.

这篇关于如何使用Retrofit Android进行OAuth 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆