Incorrect code inspection errors with AuthProviderPluginClass
I think that there are a few cases where Salesforce returns unhelpful metadata about system classes and this seems to be one of them.
In the past (< v39.0), if you wanted to write a AuthProviderPluginClass
, then you would implement the AuthProviderPlugin
interface. Now, you need to extend the AuthProviderPluginClass
instead.
I can’t see it because it’s hidden inside the system, but it looks like AuthProviderPluginClass
implements AuthProviderPlugin
.
But, in the OST, all the required methods look like they just live in AuthProviderPluginClass
The end result is that when I write my class extending AuthProviderPluginClass
, Illuminated Cloud thinks that some of my method require the override keyword, when the compiler insists that they must not.
So, an example like this:
public with sharing class DummyAuthProvider extends Auth.AuthProviderPluginClass {
public String getCustomMetadataType() {
return null;
}
public Auth.UserData getUserInfo(Map<String, String> authProviderConfiguration, Auth.AuthProviderTokenResponse response) {
return null;
}
public Auth.AuthProviderTokenResponse handleCallback(Map<String, String> authProviderConfiguration, Auth.AuthProviderCallbackState callbackState) {
return null;
}
public PageReference initiate(Map<String, String> authProviderConfiguration, String stateToPropagate) {
return null;
}
public override Auth.OAuthRefreshResult refresh(Map<String, String> authProviderConfiguration, String refreshToken) {
return null;
}
}
Is valid Apex, but all the methods without override are marked as errors by the code inspector.
Comments (2)
-
repo owner -
repo owner - changed status to resolved
Delivered in 2.1.4.9. Note that you must regenerate your OST for the fix to take effect.
- Log in to comment
Fix committed for inclusion in the next release. You will need to regenerate your OST after taking delivery of that build after which the OST's version of
Auth.AuthProviderPluginClass
will be:and a class like the following can be created simply by extending that base class and using IC's implement/override methods action (or the code intention to fix an incomplete concrete class):