Skip to content

Commit 47aee87

Browse files
committed
Add IDTokenSource
1 parent d59de25 commit 47aee87

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
package com.databricks.sdk.core.oauth;
22

3+
/**
4+
* Represents an ID Token provided by an identity provider from an OAuth flow.
5+
* IDToken is a token that can be exchanged for an access token.
6+
*/
37
public class IDToken {
4-
}
8+
// The string value of the ID Token
9+
private final String value;
10+
11+
/**
12+
* Constructs an IDToken with a value.
13+
* @param value The ID Token string.
14+
*/
15+
public IDToken(String value) {
16+
this.value = value;
17+
}
18+
19+
public String getValue() {
20+
return value;
21+
}
22+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
package com.databricks.sdk.core.oauth;
22

3+
/**
4+
* IDTokenSource is anything that returns an IDToken given an audience.
5+
*/
36
public interface IDTokenSource {
7+
/**
8+
* Retrieves an ID Token for the specified audience.
9+
*
10+
* @param audience The intended recipient of the ID Token.
11+
* @return An {@link IDToken} containing the token value.
12+
*/
13+
IDToken getIDToken(String audience);
414
}
15+

0 commit comments

Comments
 (0)