If you have the Holy Ghost and act under it’s direction, then you are acting with God’s Priesthood. (see Acts 10:44-48, Mark 9:38-40, Esaias received from God, not Abraham-D&C 84:6-14, St. John, 3 Nephites and 144,000 are not directed by a church-D&C 77:11)
The priesthood is the authority to act in the name of God. As with all the other ordinances of the church, they are symbols and not the real deal. Just because someone lays hands on your head and tells you that you have the priesthood of God, doesn’t mean that you do. You have authority to do certain things in the church, but that doesn’t mean that God accepts what you do or that you have any power in heaven. If you go sleep around and don’t get caught, the church will still honor your priesthood and let you act for the church. But, God is not bound to honor what the church honors. Just because the church records say that a person has the priesthood does not mean that God accepts that man as having the priesthood.
Anyone acting by the direction of the spirit has God’s authority because they are obeying God’s voice. If God tells you to do something, then you have the authority of God to do it. That’s why Nephi told us his authority came from the Holy Ghost.
22 And the Holy Ghost giveth authority that I should speak these things, and deny them not. (1 Nephi 10:22)