files/en-us/web/api/rtcpeerconnection/setidentityprovider/index.md
{{APIRef("WebRTC")}}
The setIdentityProvider() method of the {{domxref("RTCPeerConnection")}} interface sets the Identity Provider (IdP) to the triplet given in parameter: its name, the protocol used to communicate with it (optional) and an optional username.
The IdP will be used only when an assertion is needed.
If the {{domxref("RTCPeerConnection.signalingState", "signalingState")}} is set to "closed", an InvalidStateError is raised.
setIdentityProvider(domainname)
setIdentityProvider(domainname, protocol)
setIdentityProvider(domainname, protocol, username)
domainname
protocol {{optional_Inline}}
"default" and is used to determine the URL where the IdP is listening.username {{optional_Inline}}
None ({{jsxref("undefined")}}).
const pc = new RTCPeerConnection();
pc.setIdentityProvider("developer.mozilla.org");
{{Specifications}}
{{Compat}}