Azure / Azure/azure-libraries-for-java

[FEATURE REQ] Expose immutableID property during User creation/reading

オープン
#722 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
AAD customer-reported feature-request Mgmt
主要言語
Java
スター
97
フォーク
102
PR マージ指標
30日以内にマージされた PR はありません

説明

**Is your feature request related to a problem? Please describe.**
In order to use Azure/AzureAD with a federated, external IDP (https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-saml-protocol-reference) it is important to define a users immutable ID during creation so the external IDP can use it. This parameter is already present in the `UserCreateParametersInner` class but not exposed to be set in the fluent API.

**Describe the solution you'd like**
The fluent API should expose this parameter so it can be set during user creation (and also when retrieving the users information again from Azure.

**Describe alternatives you've considered**
At the moment our workaround is to set this private property via reflection magic which works (example is in Kotlin):
```kotlin
fun WithCreate.withThisImmutableId(immutableId: String): WithCreate {
val user = this as ActiveDirectoryUser

val paramField = user.javaClass.getDeclaredField("createParameters")
paramField.isAccessible = true
val innerParams = paramField.get(user) as UserCreateParametersInner
innerParams.withImmutableId(immutableId)

return this
}
```
extraction can be performed similar also via reflection:
```kotlin
val getInnerAsyncMethod = adUser.javaClass.getDeclaredMethod("getInnerAsync")
getInnerAsyncMethod.isAccessible = true
@Suppress("UNCHECKED_CAST")
val obInner = getInnerAsyncMethod.invoke(adUser) as Observable
val innerUser = obInner.toBlocking().first()

return innerUser.immutableId()
```

Do you accept PRs regarding this issue? We could supply an extension PR to the fluent API if you like.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

UserCreateParametersInner と ActiveDirectoryUser で使用されている fluent API の実装から始め、その後、issue に示されている createParameters と getInnerAsync のパスを調べてください。immutableId を fluent API で設定でき、返されたユーザーから reflection なしで取得できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, java
領域
api, authentication
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。