• Joseph Pingleton
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hello,

I'm brand new to Apex and I'm hopeing someone can assist me in writing a simple test class for the below auto redirecting vf page:

VF Page
<apex:page controller="pagedirections" action="{!urlRedirection}">
</apex:page>

Controller
public class pagedirections {
                
    public PageReference urlRedirection() {

        string url = 'https://www.example.com/login?emailAddress=' + UserInfo.getUserEmail();

          PageReference page = new PageReference(url);
          page.setRedirect(true);
          return page;
    }
}

I truly won't be writing code much and I simply want to be able to push the apex class over to production. Any help with a test class would be greatly appreciated! Thanks!
Hello,

I'm brand new to Apex and I'm hopeing someone can assist me in writing a simple test class for the below auto redirecting vf page:

VF Page
<apex:page controller="pagedirections" action="{!urlRedirection}">
</apex:page>

Controller
public class pagedirections {
                
    public PageReference urlRedirection() {

        string url = 'https://www.example.com/login?emailAddress=' + UserInfo.getUserEmail();

          PageReference page = new PageReference(url);
          page.setRedirect(true);
          return page;
    }
}

I truly won't be writing code much and I simply want to be able to push the apex class over to production. Any help with a test class would be greatly appreciated! Thanks!
Hello All, 

    Running into problems whilst deleting a custom object. Please help! Attaching the error screenshot ...

User-added image
Regards
Rey
 
Dear All,
I'm struggling with OAuth 2.0. In fact, the customer asked to recall external API from Salesforce that needs OAuth 2.0 authentication with grant type=client_credentials.
Do you know what should I do? I need your help as soon as possible since I need to release next week. I've configured Named Credential and I'm trying to configure the Auth. provider, but I don't know how. I've seen there are some standard Auth providers like google and facebook, but how can I configure the customer one?

The customer gave me the following info:
Client_id= xxxxx
Client_Secret= xxx
- url = xxxx
grant_type = client_credentials
- Method: POST
- Header: authorization: Basic base64(client_id:client_secret) (This header can only be used if 'client_id' and 'client_secret' are NOT found within the message body and vice versa!)
- Header: content-type: application/x-www-form-urlencoded
- Endpoint = /auth/oauth/v2/token
- Parameters = Parameters: grant_type=client_credentials&client_id=a-client_id&client_secret=a-client_secret&scope=a-list-of-scope-values
- Header = content-type: application/json
- Body = { "access_token":"xxxx", "token_type":"Bearer", "expires_in":3600, "scope":"openid email" }