2016-11-15 7 views
0

ASP.Net MVCクライアント用のIdentityserver4を正常に設定しましたが、すべて正常に動作しています。 Androidアプリクライアントを開発しようとしています。 MVCクライアントとAndroidクライアントは、同じIdentity Serverを使用して認証と承認を行います。 Androidクライアントの場合、私は"AppAuth-Android" GitHubライブラリを探しています。しかし、IdentityServer4でライブラリを使用するためのサンプルやヘルプが見つかりませんでした。私は "AppAuth-Android"ライブラリのドキュメントを読んでいます。AppAuth-AndroidとIdentityServer4の併用方法は?

一般に、AppAuthはネイティブアプリをサポートするすべての認証サーバー(AS)で動作します。

私の質問は、1)私のアイデンティティサーバーをAndroidアプリケーションと連携するように設定する方法です。
2)「AppAuth-Android」を使用してAndroidアプリを認証する方法

ご協力いただきまして誠にありがとうございます。

「AppAuth-Android」のタグを作成してください。

+0

IdentityServerの観点から、クライアントにハイブリッド許可タイプと必須のPKCEを設定してください。ロギングをオンにして、クライアントが接続するときに何が起こるかを確認します。 – leastprivilege

+0

AppAuthとIdentityServer4との間に互換性がない場合は、IS4の問題追跡ツールで問題を開いてください。 – leastprivilege

+0

私はそれを試して、あなたを更新します。ありがとう – Madhu

答えて

0

Basiclly、あなたはとにかく、あなたがこの問題の詳細についてはhttps://github.com/IdentityServer/IdentityServer4/issues/479を参照することができidentityserver4

new Client 
      { 
       ClientId = "client.android", 
       RequireClientSecret = false, 
       ClientName = "Android app client", 
       AllowedGrantTypes = GrantTypes.Code, 
       RequirePkce = true, 
       RequireConsent = false, 

       RedirectUris = { "net.openid.appauthdemo://oauth2redirect" }, 
       AllowedScopes = 
       { 
        IdentityServerConstants.StandardScopes.OpenId, 
        IdentityServerConstants.StandardScopes.Profile, 
        IdentityServerConstants.StandardScopes.Email, 
        IdentityServerConstants.StandardScopes.Phone, 
        "api1" 
       }, 
       AllowOfflineAccess = true 
      } 

ために、次の設定を使用することができます。

0

サーバー側のデータは、アンドロイドアプリで使用されているデータと同じである必要があります。

あなたが持っているべきでAndroidアプリでは、サーバー側

new Client 
     { 
      ClientId = "myClientId", 
      ClientName = "myClientName", 
      AllowedGrantTypes = GrantTypes.CodeAndClientCredentials, 
      RequireConsent = false, 

      ClientSecrets = 
      { 
       new Secret("myClientSecret".Sha256()) 
      }, 

      RedirectUris = { "myRedirectUri://callback" }, 

      AllowedScopes = 
      { 
       IdentityServerConstants.StandardScopes.OpenId, 
       IdentityServerConstants.StandardScopes.Profile, 
       IdentityServerConstants.StandardScopes.Email, 
       IdentityServerConstants.StandardScopes.Phone, 
      }, 

      AllowOfflineAccess = true 
     } 

にクライアントを追加し、同じclientIdclientSecretredirectUri ..

は、私はあなたがすべきAppAuth-のAndroidライブラリを使用してサンプルを作りましたgradle.propertiesのデータを編集してください。here

+0

詳細だけでなく、 – yass

関連する問題