Created
July 20, 2021 02:40
-
-
Save ceelsoin/e82e93bf4a3f1b446f0e74904f33d868 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async getKeycloakUserByEmail(email: String): Promise<any> { | |
const config = { | |
headers: { | |
Authorization: 'Bearer '+ await this.getApplicationServiceToken(), | |
} | |
}; | |
return axios.get(`${this.BASE_URL}/auth/admin/realms/shallwe/users?email=${email}`, config) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async updatePassword(password: String, keycloakUserId: String): Promise<any>{ | |
const config = { | |
headers: { | |
'authorization': 'Bearer '+ await this.getApplicationServiceToken(), | |
'content-type': 'application/json' | |
} | |
} | |
const payload = { | |
type: "password", | |
value: password, | |
temporary: false | |
} | |
return axios.put(`${this.BASE_URL}/auth/admin/realms/shallwe/users/${keycloakUserId}/reset-password`, payload, config) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment