【问题标题】:Github Authorization in android app安卓应用中的 Github 授权
【发布时间】:2016-05-17 09:27:25
【问题描述】:

我正在为 github 开发 android 应用程序,该应用程序将显示用户信息、存储库、贡献等。但我在用户登录设置方面遇到了困难。输入用户名和密码后要点击的 api 调用是什么?

我正在使用 React Native 进行 Android 开发

谢谢。

<View style={styles.loginList}>
  <TextInput value={this.state.username} onChangeText={(username) => this.setState({username})} /> 
</View>
<View style={styles.loginList}>
  <TextInput value={this.state.password} onChangeText={(password) => this.setState({password})} secureTextEntry={true} /> 
</View>
<TouchableHighlight activeOpacity={1} underlayColor='#F19793' onPress={()=>this._handleLogin(this.state.username,this.state.password)}>
  <View style={styles.buttonWrapper}>
    <Text style={styles.buttonText}>Sign In</Text>
  </View>
</TouchableHighlight>
.....
_handleLogin:function(username,password){

  //api call
}

【问题讨论】:

  • 请向我们展示您的代码

标签: javascript android reactjs react-native github-api


【解决方案1】:

Github 需要 oauth,不会有简单的 API 调用来进行身份验证。有关使用 Github 进行身份验证的示例,请参阅 https://github.com/mrblueblue/react-native-oauth

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-11-21
    • 2015-01-25
    • 1970-01-01
    • 2011-10-04
    • 1970-01-01
    • 2014-02-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多